OpenJDK / amber / amber
changeset 44231:62df7efbd833
Merge
author | lana |
---|---|
date | Mon, 13 Mar 2017 19:58:38 +0000 |
parents | 03eb0d2f8485 6f46f350a21b |
children | e78f190d9ab1 |
files | hotspot/test/gc/arguments/TestExplicitGCInvokesConcurrentAndUnloadsClasses.java hotspot/test/gc/startup_warnings/TestDefNewCMS.java hotspot/test/gc/startup_warnings/TestParNewCMS.java hotspot/test/gc/startup_warnings/TestParNewSerialOld.java hotspot/test/gc/startup_warnings/TestUseAutoGCSelectPolicy.java hotspot/test/runtime/NMT/AutoshutdownNMT.java jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest5.out jaxp/test/javax/xml/jaxp/unittest/common/prettyprint/xmltest7.out jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentFragment.java jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.properties jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties jdk/make/src/classes/build/tools/jigsaw/Graph.java jdk/src/java.base/macosx/native/launcher/jexec.c jdk/src/java.base/share/classes/sun/security/provider/certpath/PKIXTimestampParameters.java jdk/src/java.base/share/classes/sun/security/util/CertConstraintParameters.java jdk/src/java.base/share/native/libzip/zlib-1.2.8/ChangeLog jdk/src/java.base/share/native/libzip/zlib-1.2.8/README jdk/src/java.base/share/native/libzip/zlib-1.2.8/compress.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/crc32.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzclose.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzguts.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzlib.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzread.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzwrite.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/infback.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffixed.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/patches/ChangeLog_java jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/uncompr.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/zadler32.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/zconf.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/zcrc32.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/zlib.h jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.c jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.h jdk/src/java.base/unix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java jdk/src/jdk.desktop/share/classes/jdk/awt/AWTUtils.java jdk/src/jdk.desktop/share/classes/module-info.java jdk/test/java/awt/jdk/TestJDKAWTUtils.java jdk/test/java/lang/StackWalker/CountLocalSlots.java jdk/test/java/lang/StackWalker/LocalsCrash.java jdk/test/java/lang/invoke/lambda/MetafactorySamReturnTest.java jdk/test/java/lang/invoke/modules/ModuleAccessControlTest.java jdk/test/java/lang/invoke/modules/src/m1/module-info.java jdk/test/java/lang/invoke/modules/src/m1/p1/Main.java jdk/test/java/lang/invoke/modules/src/m1/p1/Type1.java jdk/test/java/lang/invoke/modules/src/m1/p2/Type2.java jdk/test/java/lang/invoke/modules/src/m2/module-info.java jdk/test/java/lang/invoke/modules/src/m2/q1/Type1.java jdk/test/java/lang/invoke/modules/src/m2/q2/Type2.java jdk/test/java/util/stream/bootlib/java.base/java/util/stream/SpliteratorTestHelper.java jdk/test/javax/xml/jaxp/common/8035437/Document.java jdk/test/javax/xml/jaxp/common/8035437/DocumentImpl.java jdk/test/javax/xml/jaxp/common/8035437/Node.java jdk/test/sun/security/krb5/auto/BadKdc.java jdk/test/sun/security/krb5/auto/BadKdc1.java jdk/test/sun/security/krb5/auto/BadKdc2.java jdk/test/sun/security/krb5/auto/BadKdc3.java jdk/test/sun/security/krb5/auto/BadKdc4.java jdk/test/sun/security/krb5/auto/CommMatcher.java jdk/test/sun/security/krb5/auto/MaxRetries.java jdk/test/sun/security/krb5/auto/TcpTimeout.java jdk/test/sun/security/krb5/auto/UdpTcp.java jdk/test/sun/text/IntHashtable/Bug4170614Test.java langtools/.hgtags langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java |
diffstat | 1045 files changed, 40709 insertions(+), 31177 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Thu Mar 09 21:35:20 2017 +0000 +++ b/.hgtags Mon Mar 13 19:58:38 2017 +0000 @@ -1,3 +1,5 @@ +fa3e76b477829afc4476f0b725cfaa440a6fd917 jdk-9+157 +b5015f742ba648184bb7fc547197bd33ebfde30d jdk-9+158 1cc8dd79fd1cd13d36b385196271a29632c67c3b jdk7-b24 bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25 5ae7db536e3fcf6be78e45b240a9058095e0ed38 jdk7-b26 @@ -399,3 +401,5 @@ 8c70d170e62c0c58b5bc3ba666bd140399b98c9c jdk-10+0 45b751afd11e6c05991cf4913c5a0ac3304fcc4e jdk-9+154 f4aff695ffe05cfdb69d8af25a4ddc6a029754ea jdk-9+155 +06bce0388880b5ff8e040e4a9d72a3ea11dac321 jdk-9+156 +74116beae88a8f17a80301aa6c83865c82f10ece jdk-10+1
--- a/.hgtags-top-repo Thu Mar 09 21:35:20 2017 +0000 +++ b/.hgtags-top-repo Mon Mar 13 19:58:38 2017 +0000 @@ -396,5 +396,9 @@ 71a766d4c18041a7f833ee22823125b02e1a7f1e jdk-9+151 ef056360ddf3977d7d2ddbeb456a4d612d19ea05 jdk-9+152 816a6d03a7c44edfbd8780110529f1bdc3964fb9 jdk-9+153 +8d22611ffb6540bc1ace64a00c048c8b82d8c69a jdk-10+0 8d26916eaa21b689835ffc1c0dbf12470aa9be61 jdk-9+154 688a3863c00ebc089ab17ee1fc46272cbbd96815 jdk-9+155 +783ec7542cf7154e5d2b87f55bb97d28f81e9ada jdk-9+156 +4eb77fb98952dc477a4229575c81d2263a9ce711 jdk-9+157 +a4087bc10a88a43ea3ad0919b5b4af1c86977221 jdk-9+158
--- a/.jcheck/conf Thu Mar 09 21:35:20 2017 +0000 +++ b/.jcheck/conf Mon Mar 13 19:58:38 2017 +0000 @@ -1,1 +1,1 @@ -project=jdk9 +project=jdk10
--- a/common/autoconf/basics.m4 Thu Mar 09 21:35:20 2017 +0000 +++ b/common/autoconf/basics.m4 Mon Mar 13 19:58:38 2017 +0000 @@ -1202,6 +1202,18 @@ # Check for support for specific options in bash AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS], [ + # Check bash version + # Extra [ ] to stop m4 mangling + [ BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` ] + AC_MSG_CHECKING([bash version]) + AC_MSG_RESULT([$BASH_VER]) + + BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1` + BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2` + if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then + AC_MSG_ERROR([bash version 3.2 or better is required]) + fi + # Test if bash supports pipefail. AC_MSG_CHECKING([if bash supports pipefail]) if ${BASH} -c 'set -o pipefail'; then
--- a/common/autoconf/generated-configure.sh Thu Mar 09 21:35:20 2017 +0000 +++ b/common/autoconf/generated-configure.sh Mon Mar 13 19:58:38 2017 +0000 @@ -5170,7 +5170,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1486175373 +DATE_WHEN_GENERATED=1486679715 ############################################################################### # @@ -24092,6 +24092,20 @@ fi + # Check bash version + # Extra [ ] to stop m4 mangling + BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking bash version" >&5 +$as_echo_n "checking bash version... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH_VER" >&5 +$as_echo "$BASH_VER" >&6; } + + BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1` + BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2` + if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then + as_fn_error $? "bash version 3.2 or better is required" "$LINENO" 5 + fi + # Test if bash supports pipefail. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports pipefail" >&5 $as_echo_n "checking if bash supports pipefail... " >&6; }
--- a/common/autoconf/version-numbers Thu Mar 09 21:35:20 2017 +0000 +++ b/common/autoconf/version-numbers Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# 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 @@ -25,7 +25,7 @@ # Default version numbers to use unless overridden by configure -DEFAULT_VERSION_MAJOR=9 +DEFAULT_VERSION_MAJOR=10 DEFAULT_VERSION_MINOR=0 DEFAULT_VERSION_SECURITY=0 DEFAULT_VERSION_PATCH=0
--- a/common/bin/unshuffle_list.txt Thu Mar 09 21:35:20 2017 +0000 +++ b/common/bin/unshuffle_list.txt Mon Mar 13 19:58:38 2017 +0000 @@ -361,8 +361,8 @@ jdk/src/java.base/share/native/libverify/check_format.c : jdk/src/share/native/common/check_format.c jdk/src/java.base/share/native/libverify/opcodes.in_out : jdk/src/share/native/common/opcodes.in_out jdk/src/java.base/share/native/libzip : jdk/src/share/native/java/util/zip -jdk/src/java.base/share/native/libzip/zlib-1.2.8 : jdk/src/share/native/java/util/zip/zlib-1.2.8 -jdk/src/java.base/share/native/libzip/zlib-1.2.8/patches/ChangeLog_java : jdk/src/share/native/java/util/zip/zlib-1.2.8/patches/ChangeLog_java +jdk/src/java.base/share/native/libzip/zlib : jdk/src/share/native/java/util/zip/zlib +jdk/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java : jdk/src/share/native/java/util/zip/zlib/patches/ChangeLog_java jdk/src/java.base/unix/classes/java/io : jdk/src/solaris/classes/java/io jdk/src/java.base/unix/classes/java/lang : jdk/src/solaris/classes/java/lang jdk/src/java.base/unix/classes/java/net : jdk/src/solaris/classes/java/net
--- a/common/conf/jib-profiles.js Thu Mar 09 21:35:20 2017 +0000 +++ b/common/conf/jib-profiles.js Mon Mar 13 19:58:38 2017 +0000 @@ -1080,7 +1080,7 @@ + "." + (minor != null ? minor : version_numbers.get("DEFAULT_VERSION_MINOR")) + "." + (security != null ? security : version_numbers.get("DEFAULT_VERSION_SECURITY")) + "." + (patch != null ? patch : version_numbers.get("DEFAULT_VERSION_PATCH")); - while (version.match(".*\.0$")) { + while (version.match(".*\\.0$")) { version = version.substring(0, version.length - 2); } return version;
--- a/common/nb_native/nbproject/configurations.xml Thu Mar 09 21:35:20 2017 +0000 +++ b/common/nb_native/nbproject/configurations.xml Mon Mar 13 19:58:38 2017 +0000 @@ -1223,7 +1223,7 @@ <in>check_format.c</in> </df> <df name="libzip"> - <df name="zlib-1.2.8"> + <df name="zlib"> <in>compress.c</in> <in>deflate.c</in> <in>gzclose.c</in> @@ -38283,7 +38283,7 @@ <pElem>../../jdk/src/java.base/unix/native/include</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../build/support/headers/java.base</pElem> <pElem>../../make</pElem> </incDir> @@ -38304,7 +38304,7 @@ <pElem>../../jdk/src/java.base/unix/native/include</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../build/support/headers/java.base</pElem> <pElem>../../make</pElem> </incDir> @@ -38325,7 +38325,7 @@ <pElem>../../jdk/src/java.base/unix/native/include</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../build/support/headers/java.base</pElem> <pElem>../../make</pElem> </incDir> @@ -38346,7 +38346,7 @@ <pElem>../../jdk/src/java.base/unix/native/include</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../build/support/headers/java.base</pElem> <pElem>../../make</pElem> </incDir> @@ -38367,7 +38367,7 @@ <pElem>../../jdk/src/java.base/unix/native/include</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../build/support/headers/java.base</pElem> <pElem>../../make</pElem> </incDir> @@ -38377,14 +38377,14 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/compress.c" - ex="false" - tool="0" - flavor2="0"> - <cTool flags="4"> - </cTool> - </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/deflate.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/compress.c" + ex="false" + tool="0" + flavor2="0"> + <cTool flags="4"> + </cTool> + </item> + <item path="../../jdk/src/java.base/share/native/libzip/zlib/deflate.c" ex="false" tool="0" flavor2="0"> @@ -38394,7 +38394,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzclose.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/gzclose.c" ex="false" tool="0" flavor2="0"> @@ -38404,7 +38404,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzlib.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/gzlib.c" ex="false" tool="0" flavor2="0"> @@ -38414,7 +38414,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzread.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/gzread.c" ex="false" tool="0" flavor2="0"> @@ -38424,7 +38424,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/gzwrite.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/gzwrite.c" ex="false" tool="0" flavor2="0"> @@ -38434,7 +38434,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/infback.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/infback.c" ex="false" tool="0" flavor2="0"> @@ -38444,7 +38444,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inffast.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/inffast.c" ex="false" tool="0" flavor2="0"> @@ -38454,7 +38454,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inflate.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/inflate.c" ex="false" tool="0" flavor2="0"> @@ -38464,7 +38464,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/inftrees.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/inftrees.c" ex="false" tool="0" flavor2="0"> @@ -38474,7 +38474,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/trees.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/trees.c" ex="false" tool="0" flavor2="0"> @@ -38484,7 +38484,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/uncompr.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/uncompr.c" ex="false" tool="0" flavor2="0"> @@ -38494,7 +38494,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zadler32.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/zadler32.c" ex="false" tool="0" flavor2="0"> @@ -38504,7 +38504,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zcrc32.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/zcrc32.c" ex="false" tool="0" flavor2="0"> @@ -38514,7 +38514,7 @@ </preprocessorList> </cTool> </item> - <item path="../../jdk/src/java.base/share/native/libzip/zlib-1.2.8/zutil.c" + <item path="../../jdk/src/java.base/share/native/libzip/zlib/zutil.c" ex="false" tool="0" flavor2="0"> @@ -41203,7 +41203,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41232,7 +41232,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41261,7 +41261,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41290,7 +41290,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41319,7 +41319,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41348,7 +41348,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41377,7 +41377,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41406,7 +41406,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41435,7 +41435,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41464,7 +41464,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41493,7 +41493,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41522,7 +41522,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41551,7 +41551,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41580,7 +41580,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41609,7 +41609,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41638,7 +41638,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41667,7 +41667,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41696,7 +41696,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41725,7 +41725,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41754,7 +41754,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41783,7 +41783,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41812,7 +41812,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41841,7 +41841,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41870,7 +41870,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41899,7 +41899,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41928,7 +41928,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41957,7 +41957,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -41986,7 +41986,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42015,7 +42015,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42044,7 +42044,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42073,7 +42073,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42102,7 +42102,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42131,7 +42131,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42160,7 +42160,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42189,7 +42189,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42218,7 +42218,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42247,7 +42247,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42276,7 +42276,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42305,7 +42305,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42334,7 +42334,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42363,7 +42363,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42413,7 +42413,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42442,7 +42442,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -42471,7 +42471,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -46557,7 +46557,7 @@ <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjli</pElem> <pElem>../../jdk/src/java.base/share/native/libjli</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../make</pElem> </incDir> <preprocessorList> @@ -46639,15 +46639,15 @@ </preprocessorList> </cTool> </folder> - <folder path="0/jdk/src/java.base/share/native/libzip/zlib-1.2.8"> - <cTool> - <incDir> - <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/giflib</pElem> - <pElem>../../jdk/src/java.desktop/share/native/libjavajpeg</pElem> - <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> - <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <folder path="0/jdk/src/java.base/share/native/libzip/zlib"> + <cTool> + <incDir> + <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/giflib</pElem> + <pElem>../../jdk/src/java.desktop/share/native/libjavajpeg</pElem> + <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> + <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> + <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -46712,7 +46712,7 @@ <incDir> <pElem>../../jdk/src/java.base/unix/native/libjli</pElem> <pElem>../../jdk/src/java.base/share/native/libjli</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../make</pElem> </incDir> <preprocessorList> @@ -47250,7 +47250,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -47598,7 +47598,7 @@ <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen</pElem> <pElem>../../jdk/src/java.desktop/share/native/libsplashscreen/libpng</pElem> <pElem>../../jdk/src/java.desktop/unix/native/libsplashscreen</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/linux/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> @@ -47996,7 +47996,7 @@ <pElem>../../jdk/src/jdk.pack/share/native/common-unpack</pElem> <pElem>../../jdk/src/java.base/share/native/libjava</pElem> <pElem>../../jdk/src/java.base/unix/native/libjava</pElem> - <pElem>../../jdk/src/java.base/share/native/libzip/zlib-1.2.8</pElem> + <pElem>../../jdk/src/java.base/share/native/libzip/zlib</pElem> <pElem>../../jdk/src/java.base/share/native/include</pElem> <pElem>../../jdk/src/java.base/linux/native/include</pElem> <pElem>../../jdk/src/java.base/unix/native/include</pElem>
--- a/corba/.hgtags Thu Mar 09 21:35:20 2017 +0000 +++ b/corba/.hgtags Mon Mar 13 19:58:38 2017 +0000 @@ -396,5 +396,9 @@ 77f827f5bbad3ef795664bc675f72d98d156b9f8 jdk-9+151 ff8cb43c07c069b1debdee44cb88ca22db1ec757 jdk-9+152 68a8e8658511093b322a46ed04b2a321e1da2a43 jdk-9+153 +d66f97a610a6beac987740edc2bf6a70f46ba574 jdk-10+0 078ebe23b584466dc8346e620d7821d91751e5a9 jdk-9+154 a545f54babfa31aa7eb611f36031609acd617cbc jdk-9+155 +907c26240cd481579e919bfd23740797ff8ce1c8 jdk-9+156 +9383da04b385cca46b7ca67f3a39ac1b673e09fe jdk-9+157 +de6bdf38935fa753183ca288bed5c06a23c0bb12 jdk-9+158
--- a/corba/.jcheck/conf Thu Mar 09 21:35:20 2017 +0000 +++ b/corba/.jcheck/conf Mon Mar 13 19:58:38 2017 +0000 @@ -1,1 +1,1 @@ -project=jdk9 +project=jdk10
--- a/corba/src/java.corba/share/classes/module-info.java Thu Mar 09 21:35:20 2017 +0000 +++ b/corba/src/java.corba/share/classes/module-info.java Mon Mar 13 19:58:38 2017 +0000 @@ -25,6 +25,8 @@ /** * Defines the Java binding of the OMG CORBA APIs, and the RMI-IIOP API. + * + * @since 9 */ @Deprecated(since="9", forRemoval=true) module java.corba {
--- a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java Thu Mar 09 21:35:20 2017 +0000 +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java Mon Mar 13 19:58:38 2017 +0000 @@ -106,13 +106,13 @@ * * <LI>check in properties parameter, if any * - * <LI>check in the System properties + * <LI>check in the System properties, if any * * <LI>check in the orb.properties file located in the user.home - * directory (if any) + * directory, if any * - * <LI>check in the orb.properties file located in the java.home/lib - * directory (if any) + * <LI>check in the orb.properties file located in the run-time image, + * if any * * <LI>fall back on a hardcoded default behavior (use the Java IDL * implementation) @@ -170,9 +170,15 @@ * Thus, where appropriate, it is necessary that * the classes for this alternative ORBSingleton are available on the application's class path. * It should be noted that the singleton ORB is system wide. - * + * <P> * When a per-application ORB is created via the 2-arg init methods, * then it will be located using the thread context class loader. + * <P> + * The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location, + * in the Java run-time image, to search for orb.properties. + * This location is not intended for user editable configuration files. + * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties, + * and thereafter the ${java.home}/lib directory. * * @since JDK1.2 */ @@ -271,14 +277,25 @@ } String javaHome = System.getProperty("java.home"); - fileName = javaHome + File.separator - + "lib" + File.separator + "orb.properties"; - props = getFileProperties( fileName ) ; + + fileName = javaHome + File.separator + "conf" + + File.separator + "orb.properties"; + props = getFileProperties(fileName); + + if (props != null) { + String value = props.getProperty(name); + if (value != null) + return value; + } + + fileName = javaHome + File.separator + "lib" + + File.separator + "orb.properties"; + props = getFileProperties(fileName); if (props == null) - return null ; + return null; else - return props.getProperty( name ) ; + return props.getProperty(name); } } );
--- a/hotspot/.hgtags Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/.hgtags Mon Mar 13 19:58:38 2017 +0000 @@ -556,5 +556,9 @@ 2a2ac7d9f52c8cb2b80077e515b5840b947e640c jdk-9+151 31f1d26c60df7b2e516a4f84160d76ba017d4e09 jdk-9+152 217ba81b9a4ce8698200370175aa2db86a39f66c jdk-9+153 +fc7e94cb748507366b839e859f865f724467446a jdk-10+0 a9fdfd55835ef9dccb7f317b07249bd66653b874 jdk-9+154 f3b3d77a1751897413aae43ac340a130b6fa2ae1 jdk-9+155 +43139c588ea48b6504e52b6c3dec530b17b1fdb4 jdk-9+156 +b2d0a906afd73dcf27f572217eb1be0f196ec16c jdk-9+157 +4e78f30935229f13ce7c43089621cf7169f5abac jdk-9+158
--- a/hotspot/.jcheck/conf Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/.jcheck/conf Mon Mar 13 19:58:38 2017 +0000 @@ -1,1 +1,1 @@ -project=jdk9 +project=jdk10
--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1922,12 +1922,17 @@ } if (opr2->is_constant()) { + bool is_32bit = false; // width of register operand jlong imm; + switch(opr2->type()) { + case T_INT: + imm = opr2->as_constant_ptr()->as_jint(); + is_32bit = true; + break; case T_LONG: imm = opr2->as_constant_ptr()->as_jlong(); break; - case T_INT: case T_ADDRESS: imm = opr2->as_constant_ptr()->as_jint(); break; @@ -1942,14 +1947,14 @@ } if (Assembler::operand_valid_for_add_sub_immediate(imm)) { - if (type2aelembytes(opr1->type()) <= 4) + if (is_32bit) __ cmpw(reg1, imm); else __ cmp(reg1, imm); return; } else { __ mov(rscratch1, imm); - if (type2aelembytes(opr1->type()) <= 4) + if (is_32bit) __ cmpw(reg1, rscratch1); else __ cmp(reg1, rscratch1);
--- a/hotspot/src/cpu/aarch64/vm/c1_globals_aarch64.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/cpu/aarch64/vm/c1_globals_aarch64.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -45,10 +45,8 @@ // We compile very aggressively with the builtin simulator because // doing so greatly reduces run times and tests more code. define_pd_global(intx, CompileThreshold, 150 ); -define_pd_global(intx, BackEdgeThreshold, 500); #else define_pd_global(intx, CompileThreshold, 1500 ); -define_pd_global(intx, BackEdgeThreshold, 100000); #endif define_pd_global(intx, OnStackReplacePercentage, 933 ); @@ -76,6 +74,4 @@ define_pd_global(bool, CSEArrayLength, false); define_pd_global(bool, TwoOperandLIRForm, false ); -define_pd_global(intx, SafepointPollOffset, 0 ); - #endif // CPU_AARCH64_VM_C1_GLOBALS_AARCH64_HPP
--- a/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -43,7 +43,6 @@ define_pd_global(bool, ProfileInterpreter, true); define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, CompileThreshold, 10000); -define_pd_global(intx, BackEdgeThreshold, 100000); define_pd_global(intx, OnStackReplacePercentage, 140); define_pd_global(intx, ConditionalMoveLimit, 3);
--- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java Mon Mar 13 19:58:38 2017 +0000 @@ -25,6 +25,7 @@ import org.graalvm.compiler.code.CompilationResult; import org.graalvm.compiler.core.target.Backend; +import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder; import org.graalvm.compiler.hotspot.stubs.Stub; import jdk.vm.ci.hotspot.HotSpotCompiledCode; @@ -48,7 +49,7 @@ } public HotSpotCompiledCode compiledCode(CompilationResult result) { - return stub.getCompiledCode(backend); + return HotSpotCompiledCodeBuilder.createCompiledCode(null, null, result); } }
--- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -50,7 +50,7 @@ } - if (strlen(alt_root) + strlen(name) < PATH_MAX) { + if (strlen(alt_root) + strlen(name) > PATH_MAX) { // Buffer too small. return -1; }
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -150,13 +150,7 @@ // Helper methods private void printGCAlgorithm(Map flagMap) { - // print about new generation - long l = getFlagValue("UseParNewGC", flagMap); - if (l == 1L) { - System.out.println("using parallel threads in the new generation."); - } - - l = getFlagValue("UseTLAB", flagMap); + long l = getFlagValue("UseTLAB", flagMap); if (l == 1L) { System.out.println("using thread-local object allocation."); }
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -114,6 +114,8 @@ } }); + writeHeapRecordPrologue(); + // write JavaThreads writeJavaThreads();
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -45,8 +45,8 @@ * WARNING: This format is still under development, and is subject to * change without notice. * - * header "JAVA PROFILE 1.0.1" or "JAVA PROFILE 1.0.2" (0-terminated) - * u4 size of identifiers. Identifiers are used to represent + * header "JAVA PROFILE 1.0.2" (0-terminated) + * u4 size of identifiers. Identifiers are used to represent * UTF8 strings, objects, stack traces, etc. They usually * have the same size as host pointers. For example, on * Solaris and Win32, the size is 4. @@ -294,10 +294,9 @@ * u2 stack trace depth * * - * When the header is "JAVA PROFILE 1.0.2" a heap dump can optionally - * be generated as a sequence of heap dump segments. This sequence is - * terminated by an end record. The additional tags allowed by format - * "JAVA PROFILE 1.0.2" are: + * A heap dump can optionally be generated as a sequence of heap dump + * segments. This sequence is terminated by an end record. The additional + * tags allowed by format "JAVA PROFILE 1.0.2" are: * * HPROF_HEAP_DUMP_SEGMENT denote a heap dump segment * @@ -310,8 +309,6 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { - // The heap size threshold used to determine if segmented format - // ("JAVA PROFILE 1.0.2") should be used. private static final long HPROF_SEGMENTED_HEAP_DUMP_THRESHOLD = 2L * 0x40000000; // The approximate size of a heap segment. Used to calculate when to create @@ -319,7 +316,6 @@ private static final long HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE = 1L * 0x40000000; // hprof binary file header - private static final String HPROF_HEADER_1_0_1 = "JAVA PROFILE 1.0.1"; private static final String HPROF_HEADER_1_0_2 = "JAVA PROFILE 1.0.2"; // constants in enum HprofTag @@ -380,6 +376,7 @@ private static final int JVM_SIGNATURE_ARRAY = '['; private static final int JVM_SIGNATURE_CLASS = 'L'; + private static final long MAX_U4_VALUE = 0xFFFFFFFFL; int serialNum = 1; public synchronized void write(String fileName) throws IOException { @@ -469,7 +466,6 @@ // length later - hprof format requires length. out.flush(); currentSegmentStart = fos.getChannel().position(); - // write dummy length of 0 and we'll fix it later. out.writeInt(0); } @@ -479,7 +475,7 @@ protected void writeHeapRecordEpilogue() throws IOException { if (useSegmentedHeapDump) { out.flush(); - if ((fos.getChannel().position() - currentSegmentStart - 4) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) { + if ((fos.getChannel().position() - currentSegmentStart - 4L) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) { fillInHeapRecordLength(); currentSegmentStart = 0; } @@ -488,14 +484,14 @@ private void fillInHeapRecordLength() throws IOException { - // now get current position to calculate length + // now get the current position to calculate length long dumpEnd = fos.getChannel().position(); - // calculate length of heap data + // calculate the length of heap data long dumpLenLong = (dumpEnd - currentSegmentStart - 4L); // Check length boundary, overflow could happen but is _very_ unlikely - if(dumpLenLong >= (4L * 0x40000000)){ + if (dumpLenLong >= (4L * 0x40000000)) { throw new RuntimeException("Heap segment size overflow."); } @@ -517,6 +513,71 @@ fos.getChannel().position(currentPosition); } + // get the size in bytes for the requested type + private long getSizeForType(int type) throws IOException { + switch (type) { + case TypeArrayKlass.T_BOOLEAN: + return BOOLEAN_SIZE; + case TypeArrayKlass.T_INT: + return INT_SIZE; + case TypeArrayKlass.T_CHAR: + return CHAR_SIZE; + case TypeArrayKlass.T_SHORT: + return SHORT_SIZE; + case TypeArrayKlass.T_BYTE: + return BYTE_SIZE; + case TypeArrayKlass.T_LONG: + return LONG_SIZE; + case TypeArrayKlass.T_FLOAT: + return FLOAT_SIZE; + case TypeArrayKlass.T_DOUBLE: + return DOUBLE_SIZE; + default: + throw new RuntimeException( + "Should not reach here: Unknown type: " + type); + } + } + + private int getArrayHeaderSize(boolean isObjectAarray) { + return isObjectAarray? + ((int) BYTE_SIZE + 2 * (int) INT_SIZE + 2 * (int) OBJ_ID_SIZE): + (2 * (int) BYTE_SIZE + 2 * (int) INT_SIZE + (int) OBJ_ID_SIZE); + } + + // Check if we need to truncate an array + private int calculateArrayMaxLength(long originalArrayLength, + int headerSize, + long typeSize, + String typeName) throws IOException { + + long length = originalArrayLength; + + // now get the current position to calculate length + long dumpEnd = fos.getChannel().position(); + long originalLengthInBytes = originalArrayLength * typeSize; + + // calculate the length of heap data + long currentRecordLength = (dumpEnd - currentSegmentStart - 4L); + if (currentRecordLength > 0 && + (currentRecordLength + headerSize + originalLengthInBytes) > MAX_U4_VALUE) { + fillInHeapRecordLength(); + currentSegmentStart = 0; + writeHeapRecordPrologue(); + currentRecordLength = 0; + } + + // Calculate the max bytes we can use. + long maxBytes = (MAX_U4_VALUE - (headerSize + currentRecordLength)); + + if (originalLengthInBytes > maxBytes) { + length = maxBytes/typeSize; + System.err.println("WARNING: Cannot dump array of type " + typeName + + " with length " + originalArrayLength + + "; truncating to length " + length); + } + return (int) length; + } + private void writeClassDumpRecords() throws IOException { SystemDictionary sysDict = VM.getVM().getSystemDictionary(); ClassLoaderDataGraph cldGraph = VM.getVM().getClassLoaderDataGraph(); @@ -694,12 +755,16 @@ } protected void writeObjectArray(ObjArray array) throws IOException { + int headerSize = getArrayHeaderSize(true); + final int length = calculateArrayMaxLength(array.getLength(), + headerSize, + OBJ_ID_SIZE, + "Object"); out.writeByte((byte) HPROF_GC_OBJ_ARRAY_DUMP); writeObjectID(array); out.writeInt(DUMMY_STACK_TRACE_ID); - out.writeInt((int) array.getLength()); + out.writeInt(length); writeObjectID(array.getKlass().getJavaMirror()); - final int length = (int) array.getLength(); for (int index = 0; index < length; index++) { OopHandle handle = array.getOopHandleAt(index); writeObjectID(getAddressValue(handle)); @@ -707,101 +772,101 @@ } protected void writePrimitiveArray(TypeArray array) throws IOException { + int headerSize = getArrayHeaderSize(false); + TypeArrayKlass tak = (TypeArrayKlass) array.getKlass(); + final int type = (int) tak.getElementType(); + final String typeName = tak.getElementTypeName(); + final long typeSize = getSizeForType(type); + final int length = calculateArrayMaxLength(array.getLength(), + headerSize, + typeSize, + typeName); out.writeByte((byte) HPROF_GC_PRIM_ARRAY_DUMP); writeObjectID(array); out.writeInt(DUMMY_STACK_TRACE_ID); - out.writeInt((int) array.getLength()); - TypeArrayKlass tak = (TypeArrayKlass) array.getKlass(); - final int type = (int) tak.getElementType(); + out.writeInt(length); out.writeByte((byte) type); switch (type) { case TypeArrayKlass.T_BOOLEAN: - writeBooleanArray(array); + writeBooleanArray(array, length); break; case TypeArrayKlass.T_CHAR: - writeCharArray(array); + writeCharArray(array, length); break; case TypeArrayKlass.T_FLOAT: - writeFloatArray(array); + writeFloatArray(array, length); break; case TypeArrayKlass.T_DOUBLE: - writeDoubleArray(array); + writeDoubleArray(array, length); break; case TypeArrayKlass.T_BYTE: - writeByteArray(array); + writeByteArray(array, length); break; case TypeArrayKlass.T_SHORT: - writeShortArray(array); + writeShortArray(array, length); break; case TypeArrayKlass.T_INT: - writeIntArray(array); + writeIntArray(array, length); break; case TypeArrayKlass.T_LONG: - writeLongArray(array); + writeLongArray(array, length); break; default: - throw new RuntimeException("should not reach here"); + throw new RuntimeException( + "Should not reach here: Unknown type: " + type); } } - private void writeBooleanArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeBooleanArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = BOOLEAN_BASE_OFFSET + index * BOOLEAN_SIZE; out.writeBoolean(array.getHandle().getJBooleanAt(offset)); } } - private void writeByteArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeByteArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = BYTE_BASE_OFFSET + index * BYTE_SIZE; out.writeByte(array.getHandle().getJByteAt(offset)); } } - private void writeShortArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeShortArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = SHORT_BASE_OFFSET + index * SHORT_SIZE; out.writeShort(array.getHandle().getJShortAt(offset)); } } - private void writeIntArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeIntArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = INT_BASE_OFFSET + index * INT_SIZE; out.writeInt(array.getHandle().getJIntAt(offset)); } } - private void writeLongArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeLongArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = LONG_BASE_OFFSET + index * LONG_SIZE; out.writeLong(array.getHandle().getJLongAt(offset)); } } - private void writeCharArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeCharArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = CHAR_BASE_OFFSET + index * CHAR_SIZE; out.writeChar(array.getHandle().getJCharAt(offset)); } } - private void writeFloatArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeFloatArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = FLOAT_BASE_OFFSET + index * FLOAT_SIZE; out.writeFloat(array.getHandle().getJFloatAt(offset)); } } - private void writeDoubleArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeDoubleArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = DOUBLE_BASE_OFFSET + index * DOUBLE_SIZE; out.writeDouble(array.getHandle().getJDoubleAt(offset)); @@ -996,12 +1061,7 @@ // writes hprof binary file header private void writeFileHeader() throws IOException { // version string - if(useSegmentedHeapDump) { - out.writeBytes(HPROF_HEADER_1_0_2); - } - else { - out.writeBytes(HPROF_HEADER_1_0_1); - } + out.writeBytes(HPROF_HEADER_1_0_2); out.writeByte((byte)'\0'); // write identifier size. we use pointers as identifiers.
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java Mon Mar 13 19:58:38 2017 +0000 @@ -27,8 +27,6 @@ import java.lang.ref.WeakReference; import java.util.Arrays; import java.util.Iterator; -import java.util.Map; -import java.util.WeakHashMap; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaType; @@ -147,21 +145,34 @@ } } - private final Map<Class<?>, WeakReference<ResolvedJavaType>> typeMap = new WeakHashMap<>(); + private final ClassValue<WeakReference<ResolvedJavaType>> resolvedJavaType = new ClassValue<WeakReference<ResolvedJavaType>>() { + @Override + protected WeakReference<ResolvedJavaType> computeValue(Class<?> type) { + return new WeakReference<>(createClass(type)); + } + }; /** * Gets the JVMCI mirror for a {@link Class} object. * * @return the {@link ResolvedJavaType} corresponding to {@code javaClass} */ - public synchronized ResolvedJavaType fromClass(Class<?> javaClass) { - WeakReference<ResolvedJavaType> typeRef = typeMap.get(javaClass); - ResolvedJavaType type = typeRef != null ? typeRef.get() : null; - if (type == null) { - type = createClass(javaClass); - typeMap.put(javaClass, new WeakReference<>(type)); + public ResolvedJavaType fromClass(Class<?> javaClass) { + ResolvedJavaType javaType = null; + while (javaType == null) { + WeakReference<ResolvedJavaType> type = resolvedJavaType.get(javaClass); + javaType = type.get(); + if (javaType == null) { + /* + * If the referent has become null, clear out the current value + * and let computeValue above create a new value. Reload the + * value in a loop because in theory the WeakReference referent + * can be reclaimed at any point. + */ + resolvedJavaType.remove(javaClass); + } } - return type; + return javaType; } /**
--- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java Mon Mar 13 19:58:38 2017 +0000 @@ -90,17 +90,10 @@ protected InstalledCode code; /** - * Compilation result from which {@link #code} was created. - */ - protected CompilationResult compResult; - - /** * The registers destroyed by this stub (from the caller's perspective). */ private Set<Register> destroyedCallerRegisters; - private HotSpotCompiledCode compiledCode; - public void initDestroyedCallerRegisters(Set<Register> registers) { assert registers != null; assert destroyedCallerRegisters == null || registers.equals(destroyedCallerRegisters) : "cannot redefine"; @@ -184,35 +177,13 @@ public synchronized InstalledCode getCode(final Backend backend) { if (code == null) { try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) { - final StructuredGraph graph = getGraph(getStubCompilationId()); - - // Stubs cannot be recompiled so they cannot be compiled with assumptions - assert graph.getAssumptions() == null; - - if (!(graph.start() instanceof StubStartNode)) { - StubStartNode newStart = graph.add(new StubStartNode(Stub.this)); - newStart.setStateAfter(graph.start().stateAfter()); - graph.replaceFixed(graph.start(), newStart); - } - CodeCacheProvider codeCache = providers.getCodeCache(); - - compResult = new CompilationResult(toString(), GeneratePIC.getValue()); - try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) { - Suites suites = createSuites(); - emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites); - LIRSuites lirSuites = createLIRSuites(); - emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites); - assert checkStubInvariants(); - } catch (Throwable e) { - throw Debug.handle(e); - } - - assert destroyedCallerRegisters != null; + CompilationResult compResult = buildCompilationResult(backend); try (Scope s = Debug.scope("CodeInstall", compResult)) { + assert destroyedCallerRegisters != null; // Add a GeneratePIC check here later, we don't want to install // code if we don't have a corresponding VM global symbol. - compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(null, null, compResult); + HotSpotCompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(null, null, compResult); code = codeCache.installCode(null, compiledCode, null, null, false); } catch (Throwable e) { throw Debug.handle(e); @@ -226,6 +197,44 @@ return code; } + @SuppressWarnings("try") + private CompilationResult buildCompilationResult(final Backend backend) { + CompilationResult compResult = new CompilationResult(toString(), GeneratePIC.getValue()); + final StructuredGraph graph = getGraph(getStubCompilationId()); + + // Stubs cannot be recompiled so they cannot be compiled with assumptions + assert graph.getAssumptions() == null; + + if (!(graph.start() instanceof StubStartNode)) { + StubStartNode newStart = graph.add(new StubStartNode(Stub.this)); + newStart.setStateAfter(graph.start().stateAfter()); + graph.replaceFixed(graph.start(), newStart); + } + + try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) { + Suites suites = createSuites(); + emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites); + LIRSuites lirSuites = createLIRSuites(); + emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites); + assert checkStubInvariants(compResult); + } catch (Throwable e) { + throw Debug.handle(e); + } + return compResult; + } + + /** + * Gets a {@link CompilationResult} that can be used for code generation. Required for AOT. + */ + @SuppressWarnings("try") + public CompilationResult getCompilationResult(final Backend backend) { + try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) { + return buildCompilationResult(backend); + } catch (Throwable e) { + throw Debug.handle(e); + } + } + public CompilationIdentifier getStubCompilationId() { return new StubCompilationIdentifier(this); } @@ -233,7 +242,7 @@ /** * Checks the conditions a compilation must satisfy to be installed as a RuntimeStub. */ - private boolean checkStubInvariants() { + private boolean checkStubInvariants(CompilationResult compResult) { assert compResult.getExceptionHandlers().isEmpty() : this; // Stubs cannot be recompiled so they cannot be compiled with @@ -278,24 +287,4 @@ } return lirSuites; } - - /** - * Gets the HotSpotCompiledCode that was created during installation. - */ - public synchronized HotSpotCompiledCode getCompiledCode(final Backend backend) { - getCompilationResult(backend); - assert compiledCode != null; - return compiledCode; - } - - /** - * Gets the compilation result for this stub, compiling it first if necessary, and installing it - * in code. - */ - public synchronized CompilationResult getCompilationResult(final Backend backend) { - if (code == null) { - getCode(backend); - } - return compResult; - } }
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -3050,15 +3050,12 @@ thr_yield(); } -// Interface for setting lwp priorities. If we are using T2 libthread, -// which forces the use of BoundThreads or we manually set UseBoundThreads, -// all of our threads will be assigned to real lwp's. Using the thr_setprio -// function is meaningless in this mode so we must adjust the real lwp's priority +// Interface for setting lwp priorities. We are using T2 libthread, +// which forces the use of bound threads, so all of our threads will +// be assigned to real lwp's. Using the thr_setprio function is +// meaningless in this mode so we must adjust the real lwp's priority. // The routines below implement the getting and setting of lwp priorities. // -// Note: T2 is now the only supported libthread. UseBoundThreads flag is -// being deprecated and all threads are now BoundThreads -// // Note: There are three priority scales used on Solaris. Java priotities // which range from 1 to 10, libthread "thr_setprio" scale which range // from 0 to 127, and the current scheduling class of the process we
--- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -248,7 +248,9 @@ } else if ((lf = x->array()->as_LoadField()) != NULL) { ciField* field = lf->field(); if (field->is_static_constant()) { - assert(PatchALot || ScavengeRootsInCode < 2, "Constant field loads are folded during parsing"); + // Constant field loads are usually folded during parsing. + // But it doesn't happen with PatchALot, ScavengeRootsInCode < 2, or when + // holder class is being initialized during parsing (for static fields). ciObject* c = field->constant_value().as_object(); if (!c->is_null_object()) { set_constant(c->as_array()->length());
--- a/hotspot/src/share/vm/c1/c1_LIR.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1413,6 +1413,17 @@ append(c); } +void LIR_List::null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null) { + if (deoptimize_on_null) { + // Emit an explicit null check and deoptimize if opr is null + CodeStub* deopt = new DeoptimizeStub(info, Deoptimization::Reason_null_check, Deoptimization::Action_none); + cmp(lir_cond_equal, opr, LIR_OprFact::oopConst(NULL)); + branch(lir_cond_equal, T_OBJECT, deopt); + } else { + // Emit an implicit null check + append(new LIR_Op1(lir_null_check, opr, info)); + } +} void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
--- a/hotspot/src/share/vm/c1/c1_LIR.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -2113,7 +2113,7 @@ void pack64(LIR_Opr src, LIR_Opr dst) { append(new LIR_Op1(lir_pack64, src, dst, T_LONG, lir_patch_none, NULL)); } void unpack64(LIR_Opr src, LIR_Opr dst) { append(new LIR_Op1(lir_unpack64, src, dst, T_LONG, lir_patch_none, NULL)); } - void null_check(LIR_Opr opr, CodeEmitInfo* info) { append(new LIR_Op1(lir_null_check, opr, info)); } + void null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null = false); void throw_exception(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info) { append(new LIR_Op2(lir_throw, exceptionPC, exceptionOop, LIR_OprFact::illegalOpr, info)); }
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1752,8 +1752,10 @@ if (x->needs_null_check() && (needs_patching || MacroAssembler::needs_explicit_null_check(x->offset()))) { - // emit an explicit null check because the offset is too large - __ null_check(object.result(), new CodeEmitInfo(info)); + // Emit an explicit null check because the offset is too large. + // If the class is not loaded and the object is NULL, we need to deoptimize to throw a + // NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code. + __ null_check(object.result(), new CodeEmitInfo(info), /* deoptimize */ needs_patching); } LIR_Address* address; @@ -1838,8 +1840,10 @@ obj = new_register(T_OBJECT); __ move(LIR_OprFact::oopConst(NULL), obj); } - // emit an explicit null check because the offset is too large - __ null_check(obj, new CodeEmitInfo(info)); + // Emit an explicit null check because the offset is too large. + // If the class is not loaded and the object is NULL, we need to deoptimize to throw a + // NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code. + __ null_check(obj, new CodeEmitInfo(info), /* deoptimize */ needs_patching); } LIR_Opr reg = rlock_result(x, field_type);
--- a/hotspot/src/share/vm/ci/ciEnv.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/ci/ciEnv.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -101,6 +101,7 @@ _debug_info = NULL; _dependencies = NULL; _failure_reason = NULL; + _inc_decompile_count_on_failure = true; _compilable = MethodCompilable; _break_at_compile = false; _compiler_data = NULL; @@ -161,6 +162,7 @@ _debug_info = NULL; _dependencies = NULL; _failure_reason = NULL; + _inc_decompile_count_on_failure = true; _compilable = MethodCompilable_never; _break_at_compile = false; _compiler_data = NULL; @@ -902,7 +904,12 @@ if (deps.is_klass_type()) continue; // skip klass dependencies Klass* witness = deps.check_dependency(); if (witness != NULL) { - record_failure("invalid non-klass dependency"); + if (deps.type() == Dependencies::call_site_target_value) { + _inc_decompile_count_on_failure = false; + record_failure("call site target change"); + } else { + record_failure("invalid non-klass dependency"); + } return; } } @@ -1017,7 +1024,7 @@ if (failing()) { // While not a true deoptimization, it is a preemptive decompile. MethodData* mdo = method()->method_data(); - if (mdo != NULL) { + if (mdo != NULL && _inc_decompile_count_on_failure) { mdo->inc_decompile_count(); }
--- a/hotspot/src/share/vm/ci/ciEnv.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/ci/ciEnv.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -55,6 +55,7 @@ DebugInformationRecorder* _debug_info; Dependencies* _dependencies; const char* _failure_reason; + bool _inc_decompile_count_on_failure; int _compilable; bool _break_at_compile; int _num_inlined_bytecodes;
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -2269,6 +2269,7 @@ compute_offset(_monitors_offset, k, vmSymbols::monitors_name(), vmSymbols::object_array_signature()); compute_offset(_locals_offset, k, vmSymbols::locals_name(), vmSymbols::object_array_signature()); compute_offset(_operands_offset, k, vmSymbols::operands_name(), vmSymbols::object_array_signature()); + compute_offset(_mode_offset, k, vmSymbols::mode_name(), vmSymbols::int_signature()); } void java_lang_reflect_AccessibleObject::compute_offsets() { @@ -3658,6 +3659,7 @@ int java_lang_LiveStackFrameInfo::_monitors_offset; int java_lang_LiveStackFrameInfo::_locals_offset; int java_lang_LiveStackFrameInfo::_operands_offset; +int java_lang_LiveStackFrameInfo::_mode_offset; int java_lang_AssertionStatusDirectives::classes_offset; int java_lang_AssertionStatusDirectives::classEnabled_offset; int java_lang_AssertionStatusDirectives::packages_offset; @@ -3728,6 +3730,10 @@ element->obj_field_put(_operands_offset, value); } +void java_lang_LiveStackFrameInfo::set_mode(oop element, int value) { + element->int_field_put(_mode_offset, value); +} + // Support for java Assertions - java_lang_AssertionStatusDirectives. void java_lang_AssertionStatusDirectives::set_classes(oop o, oop val) {
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -1380,11 +1380,13 @@ static int _monitors_offset; static int _locals_offset; static int _operands_offset; + static int _mode_offset; public: static void set_monitors(oop info, oop value); static void set_locals(oop info, oop value); static void set_operands(oop info, oop value); + static void set_mode(oop info, int value); static void compute_offsets();
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -325,14 +325,8 @@ template(java_lang_StackStreamFactory_AbstractStackWalker, "java/lang/StackStreamFactory$AbstractStackWalker") \ template(doStackWalk_signature, "(JIIII)Ljava/lang/Object;") \ template(asPrimitive_name, "asPrimitive") \ - template(asPrimitive_int_signature, "(I)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ - template(asPrimitive_long_signature, "(J)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ - template(asPrimitive_short_signature, "(S)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ - template(asPrimitive_byte_signature, "(B)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ - template(asPrimitive_char_signature, "(C)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ - template(asPrimitive_float_signature, "(F)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ - template(asPrimitive_double_signature, "(D)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ - template(asPrimitive_boolean_signature, "(Z)Ljava/lang/LiveStackFrame$PrimitiveValue;") \ + template(asPrimitive_int_signature, "(I)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \ + template(asPrimitive_long_signature, "(J)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \ \ /* common method and field names */ \ template(object_initializer_name, "<init>") \ @@ -444,6 +438,7 @@ template(monitors_name, "monitors") \ template(locals_name, "locals") \ template(operands_name, "operands") \ + template(mode_name, "mode") \ template(oop_size_name, "oop_size") \ template(static_oop_field_count_name, "static_oop_field_count") \ template(protection_domain_name, "protection_domain") \
--- a/hotspot/src/share/vm/code/codeCache.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/code/codeCache.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1211,7 +1211,7 @@ CompiledMethodIterator iter; while(iter.next_alive()) { CompiledMethod* nm = iter.method(); - if (nm->is_marked_for_deoptimization()) { + if (nm->is_marked_for_deoptimization() && !nm->is_not_entrant()) { nm->make_not_entrant(); } }
--- a/hotspot/src/share/vm/code/nmethod.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/code/nmethod.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1146,6 +1146,14 @@ assert(state == zombie || state == not_entrant, "must be zombie or not_entrant"); assert(!is_zombie(), "should not already be a zombie"); + if (_state == state) { + // Avoid taking the lock if already in required state. + // This is safe from races because the state is an end-state, + // which the nmethod cannot back out of once entered. + // No need for fencing either. + return false; + } + // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below. nmethodLocker nml(this); methodHandle the_method(method());
--- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -488,9 +488,6 @@ _gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()), _cms_start_registered(false) { - if (ExplicitGCInvokesConcurrentAndUnloadsClasses) { - ExplicitGCInvokesConcurrent = true; - } // Now expand the span and allocate the collection support structures // (MUT, marking bit map etc.) to cover both generations subject to // collection. @@ -2559,10 +2556,8 @@ // Decide if we want to enable class unloading as part of the // ensuing concurrent GC cycle. We will collect and // unload classes if it's the case that: -// (1) an explicit gc request has been made and the flag -// ExplicitGCInvokesConcurrentAndUnloadsClasses is set, OR -// (2) (a) class unloading is enabled at the command line, and -// (b) old gen is getting really full +// (a) class unloading is enabled at the command line, and +// (b) old gen is getting really full // NOTE: Provided there is no change in the state of the heap between // calls to this method, it should have idempotent results. Moreover, // its results should be monotonically increasing (i.e. going from 0 to 1, @@ -2575,11 +2570,7 @@ // below. void CMSCollector::update_should_unload_classes() { _should_unload_classes = false; - // Condition 1 above - if (_full_gc_requested && ExplicitGCInvokesConcurrentAndUnloadsClasses) { - _should_unload_classes = true; - } else if (CMSClassUnloadingEnabled) { // Condition 2.a above - // Disjuncts 2.b.(i,ii,iii) above + if (CMSClassUnloadingEnabled) { _should_unload_classes = (concurrent_cycles_since_last_unload() >= CMSClassUnloadingMaxInterval) || _cmsGen->is_too_full();
--- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -711,29 +711,6 @@ guarantee(G1RSetSparseRegionEntries > 0 && G1RSetRegionEntries > 0 , "Sanity"); } -#ifndef PRODUCT -void HeapRegionRemSet::print() { - HeapRegionRemSetIterator iter(this); - size_t card_index; - while (iter.has_next(card_index)) { - HeapWord* card_start = _bot->address_for_index(card_index); - tty->print_cr(" Card " PTR_FORMAT, p2i(card_start)); - } - if (iter.n_yielded() != occupied()) { - tty->print_cr("Yielded disagrees with occupied:"); - tty->print_cr(" " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6) - " coarse, " SIZE_FORMAT_W(6) " fine).", - iter.n_yielded(), - iter.n_yielded_coarse(), iter.n_yielded_fine()); - tty->print_cr(" " SIZE_FORMAT_W(6) " occ (" SIZE_FORMAT_W(6) - " coarse, " SIZE_FORMAT_W(6) " fine).", - occupied(), occ_coarse(), occ_fine()); - } - guarantee(iter.n_yielded() == occupied(), - "We should have yielded all the represented cards."); -} -#endif - void HeapRegionRemSet::cleanup() { SparsePRT::cleanup_all(); } @@ -917,10 +894,6 @@ // Otherwise... break; } - assert(ParallelGCThreads > 1 || - n_yielded() == _hrrs->occupied(), - "Should have yielded all the cards in the rem set " - "(in the non-par case)."); return false; }
--- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -290,8 +290,6 @@ // consumed by the strong code roots. size_t strong_code_roots_mem_size(); - void print() PRODUCT_RETURN; - // Called during a stop-world phase to perform any deferred cleanups. static void cleanup();
--- a/hotspot/src/share/vm/oops/method.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/oops/method.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -2199,7 +2199,6 @@ ResourceMark rm; assert(is_method(), "must be method"); st->print_cr("%s", internal_name()); - // get the effect of PrintOopAddress, always, for methods: st->print_cr(" - this oop: " INTPTR_FORMAT, p2i(this)); st->print (" - method holder: "); method_holder()->print_value_on(st); st->cr(); st->print (" - constants: " INTPTR_FORMAT " ", p2i(constants()));
--- a/hotspot/src/share/vm/opto/type.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/opto/type.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -373,7 +373,7 @@ if (con_type != NULL && field->is_call_site_target()) { ciCallSite* call_site = holder->as_call_site(); if (!call_site->is_constant_call_site()) { - ciMethodHandle* target = call_site->get_target(); + ciMethodHandle* target = con.as_object()->as_method_handle(); Compile::current()->dependencies()->assert_call_site_target_value(call_site, target); } }
--- a/hotspot/src/share/vm/prims/jvm.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/prims/jvm.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -2967,14 +2967,7 @@ JVMWrapper("JVM_Yield"); if (os::dont_yield()) return; HOTSPOT_THREAD_YIELD(); - - // When ConvertYieldToSleep is off (default), this matches the classic VM use of yield. - // Critical for similar threading behaviour - if (ConvertYieldToSleep) { - os::sleep(thread, MinSleepInterval, false); - } else { - os::naked_yield(); - } + os::naked_yield(); JVM_END @@ -2998,18 +2991,7 @@ EventThreadSleep event; if (millis == 0) { - // When ConvertSleepToYield is on, this matches the classic VM implementation of - // JVM_Sleep. Critical for similar threading behaviour (Win32) - // It appears that in certain GUI contexts, it may be beneficial to do a short sleep - // for SOLARIS - if (ConvertSleepToYield) { - os::naked_yield(); - } else { - ThreadState old_state = thread->osthread()->get_state(); - thread->osthread()->set_state(SLEEPING); - os::sleep(thread, MinSleepInterval, false); - thread->osthread()->set_state(old_state); - } + os::naked_yield(); } else { ThreadState old_state = thread->osthread()->get_state(); thread->osthread()->set_state(SLEEPING);
--- a/hotspot/src/share/vm/prims/jvmtiExport.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -1230,8 +1230,12 @@ assert(thread->is_VM_thread(), "wrong thread"); // get JavaThread for whom we are proxy - JavaThread *real_thread = - (JavaThread *)((VMThread *)thread)->vm_operation()->calling_thread(); + Thread *calling_thread = ((VMThread *)thread)->vm_operation()->calling_thread(); + if (!calling_thread->is_Java_thread()) { + // cannot post an event to a non-JavaThread + return; + } + JavaThread *real_thread = (JavaThread *)calling_thread; JvmtiEnvIterator it; for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
--- a/hotspot/src/share/vm/prims/methodHandles.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/prims/methodHandles.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -1208,9 +1208,10 @@ if (reference_klass != NULL && reference_klass->is_instance_klass()) { // Emulate LinkResolver::check_klass_accessability. Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh)); - if (Reflection::verify_class_access(caller, - reference_klass, - true) != Reflection::ACCESS_OK) { + if (caller != SystemDictionary::Object_klass() + && Reflection::verify_class_access(caller, + reference_klass, + true) != Reflection::ACCESS_OK) { THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name()); } }
--- a/hotspot/src/share/vm/prims/stackwalk.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/prims/stackwalk.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -173,7 +173,11 @@ } } -oop LiveFrameStream::create_primitive_value_instance(StackValueCollection* values, int i, TRAPS) { +// Create and return a LiveStackFrame.PrimitiveSlot (if needed) for the +// StackValue at the given index. 'type' is expected to be T_INT, T_LONG, +// T_OBJECT, or T_CONFLICT. +oop LiveFrameStream::create_primitive_slot_instance(StackValueCollection* values, + int i, BasicType type, TRAPS) { Klass* k = SystemDictionary::resolve_or_null(vmSymbols::java_lang_LiveStackFrameInfo(), CHECK_NULL); instanceKlassHandle ik (THREAD, k); @@ -182,8 +186,8 @@ Symbol* signature = NULL; // ## TODO: type is only available in LocalVariable table, if present. - // ## StackValue type is T_INT or T_OBJECT. - switch (values->at(i)->type()) { + // ## StackValue type is T_INT or T_OBJECT (or converted to T_LONG on 64-bit) + switch (type) { case T_INT: args.push_int(values->int_at(i)); signature = vmSymbols::asPrimitive_int_signature(); @@ -195,42 +199,26 @@ break; case T_FLOAT: - args.push_float(values->float_at(i)); - signature = vmSymbols::asPrimitive_float_signature(); - break; - case T_DOUBLE: - args.push_double(values->double_at(i)); - signature = vmSymbols::asPrimitive_double_signature(); - break; - case T_BYTE: - args.push_int(values->int_at(i)); - signature = vmSymbols::asPrimitive_byte_signature(); - break; - case T_SHORT: - args.push_int(values->int_at(i)); - signature = vmSymbols::asPrimitive_short_signature(); - break; - case T_CHAR: - args.push_int(values->int_at(i)); - signature = vmSymbols::asPrimitive_char_signature(); - break; - case T_BOOLEAN: - args.push_int(values->int_at(i)); - signature = vmSymbols::asPrimitive_boolean_signature(); - break; + THROW_MSG_(vmSymbols::java_lang_InternalError(), "Unexpected StackValue type", NULL); case T_OBJECT: return values->obj_at(i)(); case T_CONFLICT: // put a non-null slot - args.push_int(0); - signature = vmSymbols::asPrimitive_int_signature(); + #ifdef _LP64 + args.push_long(0); + signature = vmSymbols::asPrimitive_long_signature(); + #else + args.push_int(0); + signature = vmSymbols::asPrimitive_int_signature(); + #endif + break; default: ShouldNotReachHere(); @@ -252,9 +240,19 @@ objArrayHandle array_h(THREAD, array_oop); for (int i = 0; i < values->size(); i++) { StackValue* st = values->at(i); - oop obj = create_primitive_value_instance(values, i, CHECK_(empty)); - if (obj != NULL) + BasicType type = st->type(); + int index = i; +#ifdef _LP64 + if (type != T_OBJECT && type != T_CONFLICT) { + intptr_t ret = st->get_int(); // read full 64-bit slot + type = T_LONG; // treat as long + index--; // undo +1 in StackValueCollection::long_at + } +#endif + oop obj = create_primitive_slot_instance(values, index, type, CHECK_(empty)); + if (obj != NULL) { array_h->obj_at_put(i, obj); + } } return array_h; } @@ -286,6 +284,13 @@ StackValueCollection* expressions = _jvf->expressions(); GrowableArray<MonitorInfo*>* monitors = _jvf->monitors(); + int mode = 0; + if (_jvf->is_interpreted_frame()) { + mode = MODE_INTERPRETED; + } else if (_jvf->is_compiled_frame()) { + mode = MODE_COMPILED; + } + if (!locals->is_empty()) { objArrayHandle locals_h = values_to_object_array(locals, CHECK); java_lang_LiveStackFrameInfo::set_locals(stackFrame(), locals_h()); @@ -298,6 +303,7 @@ objArrayHandle monitors_h = monitors_to_object_array(monitors, CHECK); java_lang_LiveStackFrameInfo::set_monitors(stackFrame(), monitors_h()); } + java_lang_LiveStackFrameInfo::set_mode(stackFrame(), mode); } }
--- a/hotspot/src/share/vm/prims/stackwalk.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/prims/stackwalk.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -92,11 +92,16 @@ class LiveFrameStream : public BaseFrameStream { private: + enum { + MODE_INTERPRETED = 0x01, + MODE_COMPILED = 0x02 + }; + javaVFrame* _jvf; void fill_live_stackframe(Handle stackFrame, const methodHandle& method, TRAPS); - static oop create_primitive_value_instance(StackValueCollection* values, - int i, TRAPS); + static oop create_primitive_slot_instance(StackValueCollection* values, + int i, BasicType type, TRAPS); static objArrayHandle monitors_to_object_array(GrowableArray<MonitorInfo*>* monitors, TRAPS); static objArrayHandle values_to_object_array(StackValueCollection* values, TRAPS);
--- a/hotspot/src/share/vm/runtime/arguments.cpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/runtime/arguments.cpp Mon Mar 13 19:58:38 2017 +0000 @@ -375,53 +375,17 @@ // -------------- Deprecated Flags -------------- // --- Non-alias flags - sorted by obsolete_in then expired_in: { "MaxGCMinorPauseMillis", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, - { "AutoGCSelectPauseMillis", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "UseAutoGCSelectPolicy", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "UseParNewGC", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "ExplicitGCInvokesConcurrentAndUnloadsClasses", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "ConvertSleepToYield", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, - { "ConvertYieldToSleep", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, // --- 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() }, { "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() }, - { "CMSMarkStackSizeMax", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "CMSMarkStackSize", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "G1MarkStackSize", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "ParallelMarkingThreads", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "ParallelCMSThreads", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, // -------------- Obsolete Flags - sorted by expired_in -------------- - { "UseOldInlining", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "SafepointPollOffset", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "UseBoundThreads", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "DefaultThreadPriority", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "NoYieldsInMicrolock", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "BackEdgeThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "UseNewReflection", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "ReflectionWrapResolutionErrors",JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "VerifyReflectionBytecodes", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "AutoShutdownNMT", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "NmethodSweepFraction", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "NmethodSweepCheckInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "CodeCacheMinimumFreeSpace", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, -#ifndef ZERO - { "UseFastAccessorMethods", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "UseFastEmptyMethods", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, -#endif // ZERO - { "UseCompilerSafepoints", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "AdaptiveSizePausePolicy", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "ParallelGCRetainPLAB", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "ThreadSafetyMargin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "LazyBootClassLoader", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "StarvationMonitorInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "PreInflateSpin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "JNIDetachReleasesMonitors", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "UseAltSigs", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "SegmentedHeapDumpThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "PrintOopAddress", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "PermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::jdk(10) }, - { "MaxPermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::jdk(10) }, + { "ConvertSleepToYield", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, + { "ConvertYieldToSleep", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, + { "MinSleepInterval", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, + { "PermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::undefined() }, + { "MaxPermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::undefined() }, #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() }, @@ -444,11 +408,6 @@ static AliasedFlag const aliased_jvm_flags[] = { { "DefaultMaxRAMFraction", "MaxRAMFraction" }, - { "CMSMarkStackSizeMax", "MarkStackSizeMax" }, - { "CMSMarkStackSize", "MarkStackSize" }, - { "G1MarkStackSize", "MarkStackSize" }, - { "ParallelMarkingThreads", "ConcGCThreads" }, - { "ParallelCMSThreads", "ConcGCThreads" }, { "CreateMinidumpOnCrash", "CreateCoredumpOnCrash" }, { NULL, NULL} }; @@ -1547,7 +1506,6 @@ assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC, "control point invariant"); assert(UseConcMarkSweepGC, "CMS is expected to be on here"); - assert(UseParNewGC, "ParNew should always be used with CMS"); if (FLAG_IS_DEFAULT(ParallelGCThreads)) { FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads()); @@ -1588,7 +1546,6 @@ void Arguments::set_cms_and_parnew_gc_flags() { assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC, "Error"); assert(UseConcMarkSweepGC, "CMS is expected to be on here"); - assert(UseParNewGC, "ParNew should always be used with CMS"); // Turn off AdaptiveSizePolicy by default for cms until it is complete. disable_adaptive_size_policy("UseConcMarkSweepGC"); @@ -1728,16 +1685,6 @@ NOT_LP64(ShouldNotReachHere(); return 0); } -bool Arguments::should_auto_select_low_pause_collector() { - if (UseAutoGCSelectPolicy && - !FLAG_IS_DEFAULT(MaxGCPauseMillis) && - (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) { - log_trace(gc)("Automatic selection of the low pause collector based on pause goal of %d (ms)", (int) MaxGCPauseMillis); - return true; - } - return false; -} - void Arguments::set_use_compressed_oops() { #ifndef ZERO #ifdef _LP64 @@ -1841,16 +1788,7 @@ void Arguments::select_gc_ergonomically() { #if INCLUDE_ALL_GCS if (os::is_server_class_machine()) { - if (!UseAutoGCSelectPolicy) { - FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true); - } else { - if (should_auto_select_low_pause_collector()) { - FLAG_SET_ERGO_IF_DEFAULT(bool, UseConcMarkSweepGC, true); - FLAG_SET_ERGO_IF_DEFAULT(bool, UseParNewGC, true); - } else { - FLAG_SET_ERGO_IF_DEFAULT(bool, UseParallelGC, true); - } - } + FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true); } else { FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true); } @@ -1859,7 +1797,6 @@ UNSUPPORTED_OPTION(UseParallelGC); UNSUPPORTED_OPTION(UseParallelOldGC); UNSUPPORTED_OPTION(UseConcMarkSweepGC); - UNSUPPORTED_OPTION(UseParNewGC); FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true); #endif // INCLUDE_ALL_GCS } @@ -2073,7 +2010,6 @@ if (!ClassUnloading) { FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false); FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false); - FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false); } #endif // INCLUDE_ALL_GCS } @@ -2428,18 +2364,6 @@ return false; } - if (UseConcMarkSweepGC && !UseParNewGC) { - jio_fprintf(defaultStream::error_stream(), - "It is not possible to combine the DefNew young collector with the CMS collector.\n"); - return false; - } - - if (UseParNewGC && !UseConcMarkSweepGC) { - jio_fprintf(defaultStream::error_stream(), - "It is not possible to combine the ParNew young collector with any collector other than CMS.\n"); - return false; - } - return true; } @@ -3726,11 +3650,6 @@ } } - if (UseConcMarkSweepGC && FLAG_IS_DEFAULT(UseParNewGC) && !UseParNewGC) { - // CMS can only be used with ParNew - FLAG_SET_ERGO(bool, UseParNewGC, true); - } - if (!check_vm_args_consistency()) { return JNI_ERR; }
--- a/hotspot/src/share/vm/runtime/arguments.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/runtime/arguments.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -480,9 +480,6 @@ static julong limit_by_allocatable_memory(julong size); // Setup heap size static void set_heap_size(); - // Based on automatic selection criteria, should the - // low pause collector be used. - static bool should_auto_select_low_pause_collector(); // Bytecode rewriting static void set_bytecode_flags();
--- a/hotspot/src/share/vm/runtime/globals.hpp Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/src/share/vm/runtime/globals.hpp Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -1159,13 +1159,6 @@ product_pd(bool, DontYieldALot, \ "Throw away obvious excess yield calls") \ \ - product(bool, ConvertSleepToYield, true, \ - "Convert sleep(0) to thread yield ") \ - \ - product(bool, ConvertYieldToSleep, false, \ - "Convert yield to a sleep of MinSleepInterval to simulate Win32 " \ - "behavior") \ - \ develop(bool, UseDetachedThreads, true, \ "Use detached threads that are recycled upon termination " \ "(for Solaris only)") \ @@ -1479,11 +1472,6 @@ "A System.gc() request invokes a concurrent collection; " \ "(effective only when using concurrent collectors)") \ \ - product(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false, \ - "A System.gc() request invokes a concurrent collection and " \ - "also unloads classes during such a concurrent gc cycle " \ - "(effective only when UseConcMarkSweepGC)") \ - \ product(bool, GCLockerInvokesConcurrent, false, \ "The exit of a JNI critical section necessitating a scavenge, " \ "also kicks off a background concurrent collection") \ @@ -1501,9 +1489,6 @@ product(bool, UseCMSBestFit, true, \ "Use CMS best fit allocation strategy") \ \ - product(bool, UseParNewGC, false, \ - "Use parallel threads in the new generation") \ - \ product(uintx, ParallelGCBufferWastePct, 10, \ "Wasted fraction of parallel allocation buffer") \ range(0, 100) \ @@ -2059,13 +2044,6 @@ "Maximum fraction (1/n) of virtual memory used for ergonomically "\ "determining maximum heap size") \ \ - product(bool, UseAutoGCSelectPolicy, false, \ - "Use automatic collection selection policy") \ - \ - product(uintx, AutoGCSelectPauseMillis, 5000, \ - "Automatic GC selection pause threshold in milliseconds") \ - range(0, max_uintx) \ - \ product(bool, UseAdaptiveSizePolicy, true, \ "Use adaptive generation sizing policies") \ \ @@ -3003,10 +2981,6 @@ develop(intx, DontYieldALotInterval, 10, \ "Interval between which yields will be dropped (milliseconds)") \ \ - develop(intx, MinSleepInterval, 1, \ - "Minimum sleep() interval (milliseconds) when " \ - "ConvertSleepToYield is off (used for Solaris)") \ - \ develop(intx, ProfilerPCTickThreshold, 15, \ "Number of ticks in a PC buckets to be a hotspot") \ \
--- a/hotspot/test/ProblemList.txt Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/ProblemList.txt Mon Mar 13 19:58:38 2017 +0000 @@ -73,6 +73,7 @@ serviceability/jdwp/AllModulesCommandTest.java 8168478 generic-all serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all +serviceability/jvmti/ModuleAwareAgents/ClassFileLoadHook/MAAClassFileLoadHook.java 8173936 generic-all #############################################################################
--- a/hotspot/test/TEST.groups Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/TEST.groups Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 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 @@ -209,11 +209,8 @@ gc/g1/TestShrinkToOneRegion.java \ gc/metaspace/G1AddMetaspaceDependency.java \ gc/startup_warnings/TestCMS.java \ - gc/startup_warnings/TestDefNewCMS.java \ gc/startup_warnings/TestParallelGC.java \ gc/startup_warnings/TestParallelScavengeSerialOld.java \ - gc/startup_warnings/TestParNewCMS.java \ - gc/startup_warnings/TestParNewSerialOld.java \ runtime/SharedArchiveFile/SharedArchiveFile.java # Minimal VM on Compact 2 adds in some compact2 tests
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/c1/TestUnresolvedField.jasm Mon Mar 13 19:58:38 2017 +0000 @@ -0,0 +1,38 @@ +/* + * 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. + * + */ + +public class compiler/c1/TestUnresolvedField version 52:0 { + public static Method testGetField:"()V" stack 1 locals 1 { + aconst_null; + getfield Field T.f:I; // T does not exist + return; + } + + public static Method testPutField:"()V" stack 2 locals 1 { + aconst_null; + iconst_0; + putfield Field T.f:I; // T does not exist + return; + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/compiler/c1/TestUnresolvedFieldMain.java Mon Mar 13 19:58:38 2017 +0000 @@ -0,0 +1,48 @@ +/* + * 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 8173373 + * @compile TestUnresolvedField.jasm + * @run main/othervm -XX:TieredStopAtLevel=1 -Xcomp + * -XX:CompileCommand=compileonly,compiler.c1.TestUnresolvedField::test* + * compiler.c1.TestUnresolvedFieldMain + */ + +package compiler.c1; + +public class TestUnresolvedFieldMain { + public static void main(String[] args) { + try { + TestUnresolvedField.testGetField(); + } catch (java.lang.NoClassDefFoundError error) { + // Expected + } + try { + TestUnresolvedField.testPutField(); + } catch (java.lang.NoClassDefFoundError error) { + // Expected + } + } +}
--- a/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java Mon Mar 13 19:58:38 2017 +0000 @@ -23,7 +23,6 @@ /** * @test - * @modules java.base/jdk.internal.misc * @library /test/lib / * * @run driver compiler.jsr292.ContinuousCallSiteTargetChange @@ -31,6 +30,7 @@ package compiler.jsr292; +import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; @@ -39,15 +39,26 @@ import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.invoke.MutableCallSite; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public class ContinuousCallSiteTargetChange { - static void testServer() throws Exception { + static final int ITERATIONS = Integer.parseInt(System.getProperty("iterations", "50")); + + static void runTest(Class<?> test, String... extraArgs) throws Exception { + List<String> argsList = new ArrayList<>( + List.of("-XX:+IgnoreUnrecognizedVMOptions", + "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", + "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining")); + + argsList.addAll(Arrays.asList(extraArgs)); + + argsList.add(test.getName()); + argsList.add(Integer.toString(ITERATIONS)); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+IgnoreUnrecognizedVMOptions", - "-server", "-XX:-TieredCompilation", "-Xbatch", - "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", - "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - Test.class.getName(), "100"); + argsList.toArray(new String[argsList.size()])); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); @@ -55,30 +66,42 @@ analyzer.shouldNotContain("made not compilable"); analyzer.shouldNotContain("decompile_count > PerMethodRecompilationCutoff"); + } - static void testClient() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+IgnoreUnrecognizedVMOptions", - "-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch", - "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", - "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - Test.class.getName(), "100"); + static void testServer(Class<?> test, String... args) throws Exception { + List<String> extraArgsList = new ArrayList<>( + List.of("-server", "-XX:-TieredCompilation")); + extraArgsList.addAll(Arrays.asList(args)); - OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); + runTest(test, extraArgsList.toArray(new String[extraArgsList.size()])); + } - analyzer.shouldHaveExitValue(0); + static void testClient(Class<?> test, String... args) throws Exception { + List<String> extraArgsList = new ArrayList<>( + List.of("-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1")); + extraArgsList.addAll(Arrays.asList(args)); - analyzer.shouldNotContain("made not compilable"); - analyzer.shouldNotContain("decompile_count > PerMethodRecompilationCutoff"); + runTest(test, extraArgsList.toArray(new String[extraArgsList.size()])); } public static void main(String[] args) throws Exception { - testServer(); - testClient(); + testServer(RecompilationTest.class, "-Xbatch"); + testClient(RecompilationTest.class, "-Xbatch"); + + testServer(PingPongTest.class); + testClient(PingPongTest.class); } - static class Test { + static MethodHandle findStatic(Class<?> cls, String name, MethodType mt) { + try { + return MethodHandles.lookup().findStatic(cls, name, mt); + } catch (Exception e) { + throw new Error(e); + } + } + + static class RecompilationTest { static final MethodType mt = MethodType.methodType(void.class); static final CallSite cs = new MutableCallSite(mt); @@ -96,7 +119,7 @@ } static void iteration() throws Throwable { - MethodHandle mh1 = MethodHandles.lookup().findStatic(ContinuousCallSiteTargetChange.Test.class, "f", mt); + MethodHandle mh1 = findStatic(RecompilationTest.class, "f", mt); cs.setTarget(mh1); for (int i = 0; i < 20_000; i++) { test1(); @@ -111,4 +134,38 @@ } } } + + static class PingPongTest { + static final MethodType mt = MethodType.methodType(void.class); + static final CallSite cs = new MutableCallSite(mt); + + static final MethodHandle mh = cs.dynamicInvoker(); + + static final MethodHandle ping = findStatic(PingPongTest.class, "ping", mt); + static final MethodHandle pong = findStatic(PingPongTest.class, "pong", mt); + + static void ping() { + Asserts.assertEQ(cs.getTarget(), ping, "wrong call site target"); + cs.setTarget(pong); + } + + static void pong() { + Asserts.assertEQ(cs.getTarget(), pong, "wrong call site target"); + cs.setTarget(ping); + } + + static void iteration() throws Throwable { + cs.setTarget(ping); + for (int i = 0; i < 20_000; i++) { + mh.invokeExact(); + } + } + + public static void main(String[] args) throws Throwable { + int iterations = Integer.parseInt(args[0]); + for (int i = 0; i < iterations; i++) { + iteration(); + } + } + } }
--- a/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java Mon Mar 13 19:58:38 2017 +0000 @@ -84,7 +84,7 @@ public static MethodHandle make(MethodHandle target) { LambdaForm lform = DelegatingMethodHandle.makeReinvokerForm( - target, -1, DelegatingMethodHandle.class, "reinvoker.dontInline", + target, -1, DelegatingMethodHandle.class, /*forceInline=*/false, DelegatingMethodHandle.NF_getTarget, null); return new NonInlinedReinvoker(target, lform); }
--- a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java Mon Mar 13 19:58:38 2017 +0000 @@ -44,6 +44,8 @@ * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * -XX:CompileCommand=exclude,*::check * -XX:+DoEscapeAnalysis -XX:-UseCounterDecay + * -XX:CompileCommand=dontinline,compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest,testFrame + * -XX:CompileCommand=inline,compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest,recurse * -Xbatch * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false * compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest @@ -119,14 +121,25 @@ } Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName() + "Method unexpectedly not compiled"); + Asserts.assertTrue(WB.getMethodCompilationLevel(METHOD) == 4, getName() + + "Method not compiled at level 4"); testFrame("someString", COMPILE_THRESHOLD); } private void testFrame(String str, int iteration) { Helper helper = new Helper(str); - check(iteration); + recurse(2, iteration); Asserts.assertTrue((helper.string != null) && (this != null) - && (helper != null), getName() + " : some locals are null"); + && (helper != null), String.format("%s : some locals are null", getName())); + } + private void recurse(int depth, int iteration) { + if (depth == 0) { + check(iteration); + } else { + Integer s = new Integer(depth); + recurse(depth - 1, iteration); + Asserts.assertEQ(s.intValue(), depth, String.format("different values: %s != %s", s.intValue(), depth)); + } } private void check(int iteration) {
--- a/hotspot/test/gc/arguments/TestExplicitGCInvokesConcurrentAndUnloadsClasses.java Thu Mar 09 21:35:20 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +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 TestExplicitGCInvokesConcurrentAndUnloadsClasses - * @summary Test that the flag ExplicitGCInvokesConcurrentAndUnloadsClasses is deprecated - * @bug 8170388 - * @key gc - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @run driver TestExplicitGCInvokesConcurrentAndUnloadsClasses - */ - -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; - -public class TestExplicitGCInvokesConcurrentAndUnloadsClasses { - public static void main(String[] args) throws Exception { - ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder("-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses", - "-Xlog:gc", - "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("ExplicitGCInvokesConcurrentAndUnloadsClasses was deprecated"); - output.shouldHaveExitValue(0); - } -}
--- a/hotspot/test/gc/arguments/TestSelectDefaultGC.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/gc/arguments/TestSelectDefaultGC.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -66,7 +66,6 @@ assertVMOption(output, "UseSerialGC", !isServer); // CMS is never default assertVMOption(output, "UseConcMarkSweepGC", false); - assertVMOption(output, "UseParNewGC", false); } public static void main(String[] args) throws Exception {
--- a/hotspot/test/gc/startup_warnings/TestDefNewCMS.java Thu Mar 09 21:35:20 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2013, 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 TestDefNewCMS -* @key gc -* @bug 8065972 -* @summary Test that the unsupported DefNew+CMS combination does not start -* @library /test/lib -* @modules java.base/jdk.internal.misc -* java.management -*/ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - -public class TestDefNewCMS { - - public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:-UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("It is not possible to combine the DefNew young collector with the CMS collector."); - output.shouldContain("Error"); - output.shouldHaveExitValue(1); - } - -}
--- a/hotspot/test/gc/startup_warnings/TestParNewCMS.java Thu Mar 09 21:35:20 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2013, 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 TestParNewCMS -* @key gc -* @bug 8065972 -* @summary Test that specifying -XX:+UseParNewGC on the command line logs a warning message -* @library /test/lib -* @modules java.base/jdk.internal.misc -* java.management -*/ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - - -public class TestParNewCMS { - - public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("warning: Option UseParNewGC was deprecated in version"); - output.shouldNotContain("error"); - output.shouldHaveExitValue(0); - } - -}
--- a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java Thu Mar 09 21:35:20 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2013, 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 TestParNewSerialOld -* @key gc -* @bug 8065972 -* @summary Test that the unsupported ParNew+SerialOld combination does not start -* @library /test/lib -* @modules java.base/jdk.internal.misc -* java.management -*/ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - - -public class TestParNewSerialOld { - - public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("It is not possible to combine the ParNew young collector with any collector other than CMS."); - output.shouldContain("Error"); - output.shouldHaveExitValue(1); - } - -}
--- a/hotspot/test/gc/startup_warnings/TestUseAutoGCSelectPolicy.java Thu Mar 09 21:35:20 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +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 TestUseAutoGCSelectPolicy - * @key gc - * @bug 8166461 8167494 - * @summary Test that UseAutoGCSelectPolicy and AutoGCSelectPauseMillis do print a warning message - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - */ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - -public class TestUseAutoGCSelectPolicy { - - public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseAutoGCSelectPolicy", "-XX:AutoGCSelectPauseMillis=3000", "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("UseAutoGCSelectPolicy was deprecated in version 9.0"); - output.shouldContain("AutoGCSelectPauseMillis was deprecated in version 9.0"); - output.shouldNotContain("error"); - output.shouldHaveExitValue(0); - } -}
--- a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -37,18 +37,18 @@ // Case 1: Newly obsolete flags with extra junk appended should not be treated as newly obsolete (8060449) ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:UseOldInliningPlusJunk", "-version"); + "-XX:ConvertSleepToYieldPlusJunk", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Unrecognized VM option 'UseOldInliningPlusJunk'"); // Must identify bad option. + output.shouldContain("Unrecognized VM option 'ConvertSleepToYieldPlusJunk'"); // Must identify bad option. output.shouldHaveExitValue(1); - // Case 2: Newly obsolete integer-valued flags should be recognized as newly obsolete (8073989) + // Case 2: Newly obsolete flags should be recognized as newly obsolete (8073989) ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder( - "-XX:NmethodSweepFraction=10", "-version"); + "-XX:+ConvertSleepToYield", "-version"); OutputAnalyzer output2 = new OutputAnalyzer(pb2.start()); output2.shouldContain("Ignoring option").shouldContain("support was removed"); - output2.shouldContain("NmethodSweepFraction"); + output2.shouldContain("ConvertSleepToYield"); } }
--- a/hotspot/test/runtime/CommandLine/VMAliasOptions.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/CommandLine/VMAliasOptions.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -40,11 +40,6 @@ */ public static final String[][] ALIAS_OPTIONS = { {"DefaultMaxRAMFraction", "MaxRAMFraction", "1032"}, - {"CMSMarkStackSizeMax", "MarkStackSizeMax", "1032"}, - {"CMSMarkStackSize", "MarkStackSize", "1032"}, - {"G1MarkStackSize", "MarkStackSize", "1032"}, - {"ParallelMarkingThreads", "ConcGCThreads", "2"}, - {"ParallelCMSThreads", "ConcGCThreads", "2"}, {"CreateMinidumpOnCrash", "CreateCoredumpOnCrash", "false" }, };
--- a/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -41,17 +41,9 @@ public static final String[][] DEPRECATED_OPTIONS = { // deprecated non-alias flags: {"MaxGCMinorPauseMillis", "1032"}, - {"UseParNewGC", "false"}, - {"ConvertSleepToYield", "false" }, - {"ConvertYieldToSleep", "false" }, // deprecated alias flags (see also aliased_jvm_flags): {"DefaultMaxRAMFraction", "4"}, - {"CMSMarkStackSizeMax", "1032"}, - {"CMSMarkStackSize", "1032"}, - {"G1MarkStackSize", "1032"}, - {"ParallelMarkingThreads", "2"}, - {"ParallelCMSThreads", "2"}, {"CreateMinidumpOnCrash", "false"} };
--- a/hotspot/test/runtime/LocalLong/LocalLongHelper.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/LocalLong/LocalLongHelper.java Mon Mar 13 19:58:38 2017 +0000 @@ -30,10 +30,10 @@ public class LocalLongHelper { static StackWalker sw; - static Method intValue; + static Method longValue; static Method getLocals; static Class<?> primitiveValueClass; - static Method primitiveType; + static Method primitiveSize; static Method getMethodType; static Field memberName; static Field offset; @@ -43,27 +43,29 @@ new LocalLongHelper().longArg(0xC0FFEE, 0x1234567890ABCDEFL); } - // locals[2] contains the high byte of the long argument. + // locals[2] contains the unused slot of the long argument. public long longArg(int i, long l) throws Throwable { List<StackFrame> frames = sw.walk(s -> s.collect(Collectors.toList())); Object[] locals = (Object[]) getLocals.invoke(frames.get(0)); - int locals_2 = (int) intValue.invoke(locals[2]); - if (locals_2 != 0){ - throw new RuntimeException("Expected locals_2 == 0"); + if (8 == (int) primitiveSize.invoke(locals[2])) { // Only test 64-bit + long locals_2 = (long) longValue.invoke(locals[2]); + if (locals_2 != 0){ + throw new RuntimeException("Expected locals_2 == 0"); + } } return l; // Don't want l to become a dead var } private static void setupReflectionStatics() throws Throwable { Class<?> liveStackFrameClass = Class.forName("java.lang.LiveStackFrame"); - primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveValue"); + primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveSlot"); getLocals = liveStackFrameClass.getDeclaredMethod("getLocals"); getLocals.setAccessible(true); - intValue = primitiveValueClass.getDeclaredMethod("intValue"); - intValue.setAccessible(true); + longValue = primitiveValueClass.getDeclaredMethod("longValue"); + longValue.setAccessible(true); Class<?> stackFrameInfoClass = Class.forName("java.lang.StackFrameInfo"); memberName = stackFrameInfoClass.getDeclaredField("memberName"); @@ -80,20 +82,8 @@ f.setAccessible(true); Object localsAndOperandsOption = f.get(null); - primitiveType = primitiveValueClass.getDeclaredMethod("type"); - primitiveType.setAccessible(true); - + primitiveSize = primitiveValueClass.getDeclaredMethod("size"); + primitiveSize.setAccessible(true); sw = (StackWalker) ewsNI.invoke(null, java.util.Collections.emptySet(), localsAndOperandsOption); } - - private static String type(Object o) throws Throwable { - if (primitiveValueClass.isInstance(o)) { - final char c = (char) primitiveType.invoke(o); - return String.valueOf(c); - } else if (o != null) { - return o.getClass().getName(); - } else { - return "null"; - } - } }
--- a/hotspot/test/runtime/NMT/AutoshutdownNMT.java Thu Mar 09 21:35:20 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* - * 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. - */ - -/* - * @test - * @key nmt - * @summary Test for deprecated message if -XX:-AutoShutdownNMT is specified - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - */ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - -public class AutoshutdownNMT { - - public static void main(String args[]) throws Exception { - - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:NativeMemoryTracking=detail", - "-XX:-AutoShutdownNMT", - "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Ignoring option AutoShutdownNMT"); - } -}
--- a/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java Mon Mar 13 19:58:38 2017 +0000 @@ -68,7 +68,7 @@ // Packages: none // Packages exported: none ModuleDescriptor descriptor_first_mod = - ModuleDescriptor.module("first_mod") + ModuleDescriptor.newModule("first_mod") .requires("java.base") .requires("second_mod") .build(); @@ -78,7 +78,7 @@ // Packages: p2 // Packages exported: p2 is exported to first_mod ModuleDescriptor descriptor_second_mod = - ModuleDescriptor.module("second_mod") + ModuleDescriptor.newModule("second_mod") .requires("java.base") .exports("p2", Set.of("first_mod")) .build(); @@ -89,7 +89,7 @@ // Resolves "first_mod" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("first_mod")); + .resolve(finder, ModuleFinder.of(), Set.of("first_mod")); // Map each module to the same class loader Map<String, ClassLoader> map = new HashMap<>();
--- a/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java Mon Mar 13 19:58:38 2017 +0000 @@ -66,9 +66,9 @@ // Packages: p1, p4 // Packages exported: none ModuleDescriptor descriptor_first_mod = - ModuleDescriptor.module("first_mod") + ModuleDescriptor.newModule("first_mod") .requires("java.base") - .contains(Set.of("p1", "p4")) + .packages(Set.of("p1", "p4")) .build(); // Define module: second_mod @@ -76,7 +76,7 @@ // Packages: p2 // Packages exported: p2 is exported to first_mod ModuleDescriptor descriptor_second_mod = - ModuleDescriptor.module("second_mod") + ModuleDescriptor.newModule("second_mod") .requires("java.base") .exports("p2", Set.of("first_mod")) .build(); @@ -87,7 +87,7 @@ // Resolves "first_mod" and "second_mod" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("first_mod", "second_mod")); + .resolve(finder, ModuleFinder.of(), Set.of("first_mod", "second_mod")); // Map each module to this class loader Map<String, ClassLoader> map = new HashMap<>();
--- a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary Test that if module m1 can not read module m2, then class p1.c1 - * in module m1 can not access p2.c2 in module m2. + * @summary Test that if module m1x can not read module m2x, then class p1.c1 + * in module m1x can not access p2.c2 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -47,15 +47,15 @@ import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can not read m2 -// package p2 in m2 is exported to m1 +// m1x can not read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2. -// Access denied since m1 can not read m2. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x. +// Access denied since m1x can not read m2x. // public class CheckRead { @@ -64,65 +64,65 @@ // publicly defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m3 + // Define module: m1x + // Can read: java.base, m3x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m3") + .requires("m3x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); - // Define module: m3 - // Can read: java.base, m2 + // Define module: m3x + // Can read: java.base, m2x // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") - .requires("m2") - .contains("p3") + .requires("m2x") + .packages(Set.of("p3")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); - map.put("m3", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); + map.put("m3x", MySameClassLoader.loader1); - // Create Layer that contains m1, m2 and m3 + // Create Layer that contains m1x, m2x and m3x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // 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("Failed to get IAE (p2 in m2 is exported to m1 but m2 is not readable from m1)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x but m2x is not readable from m1x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("cannot access")) {
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary Test that if module m1 can not read module m2, then class p1.c1 - * in module m1 can not access p2.c2 in module m2. + * @summary Test that if module m1x can not read module m2x, then class p1.c1 + * in module m1x can not access p2.c2 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -47,15 +47,15 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can not read m2 -// package p2 in m2 is exported to m1 +// m1x can not read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2. -// Access denied since m1 can not read m2. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x. +// Access denied since m1x can not read m2x. // public class DiffCL_CheckRead { @@ -64,65 +64,65 @@ // publicly defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m3 + // Define module: m1x + // Can read: java.base, m3x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m3") + .requires("m3x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); - // Define module: m3 - // Can read: java.base, m2 + // Define module: m3x + // Can read: java.base, m2x // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") - .requires("m2") - .contains("p3") + .requires("m2x") + .packages(Set.of("p3")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); - map.put("m3", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); + map.put("m3x", MyDiffClassLoader.loader2); - // Create Layer that contains m1, m2 and m3 + // Create Layer that contains m1x, m2x and m3x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); - assertTrue(layer.findLoader("m3") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m3x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1 but m2 is not readable from m1)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x but m2x is not readable from m1x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("cannot access")) {
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,9 +25,9 @@ /* * @test - * @summary Test that if module m1 can read module m2, but package p2 in m2 - * is exported specifically to module m3, then class p1.c1 in m1 can not - * access p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, but package p2 in m2x + * is exported specifically to module m3x, then class p1.c1 in m1x can not + * access p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -48,15 +48,15 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can read m2 -// package p2 in m2 is exported to m3 +// m1x can read m2x +// package p2 in m2x is exported to m3x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access denied since although m1 can read m2, p2 is exported only to m3. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access denied since although m1x can read m2x, p2 is exported only to m3x. // public class DiffCL_ExpQualOther { @@ -65,66 +65,66 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2, m3 + // Define module: m1x + // Can read: java.base, m2x, m3x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") - .requires("m3") + .requires("m2x") + .requires("m3x") .exports("p1") .build(); - // Define module: m2 - // Can read: java.base, m3 + // Define module: m2x + // Can read: java.base, m3x // Packages: p2 - // Packages exported: p2 is exported to m3 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m3x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m3")) + .exports("p2", Set.of("m3x")) .build(); - // Define module: m3 - // Can read: java.base, m2 + // Define module: m3x + // Can read: java.base, m2x // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") - .requires("m2") - .contains("p3") + .requires("m2x") + .packages(Set.of("p3")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); - map.put("m3", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); + map.put("m3x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); - assertTrue(layer.findLoader("m3") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m3x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3 not to m1)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x not to m1x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) {
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in m2. - * Access allowed since m1 can read m2 and package p2 is exported to m1. + * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in m2x. + * Access allowed since m1x can read m2x and package p2 is exported to m1x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -47,14 +47,14 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported to m1 +// m1x can read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access allowed since m1 can read m2 and package p2 is exported to m1. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access allowed since m1x can read m2x and package p2 is exported to m1x. // public class DiffCL_ExpQualToM1 { @@ -63,45 +63,45 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported to unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: package p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: package p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -109,7 +109,7 @@ try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1"); + throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x"); } }
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, and package p2 in m2 is - * exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, and package p2 in m2x is + * exported unqualifiedly, then class p1.c1 in m1x can read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -47,14 +47,14 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported to m1 +// m1x can read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access allowed since m1 can read m2 and package p2 is exported +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access allowed since m1x can read m2x and package p2 is exported // unqualifiedly. // public class DiffCL_ExpUnqual { @@ -64,45 +64,45 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: package p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: package p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") .exports("p2") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -110,7 +110,7 @@ try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1"); + throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x"); } }
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, but package p2 in m2 is not - * exported, then class p1.c1 in m1 can not read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, but package p2 in m2x is not + * exported, then class p1.c1 in m1x can not read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -47,13 +47,13 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x // Access denied since p2 is not exported. // public class DiffCL_PkgNotExp { @@ -63,52 +63,52 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p2") + .packages(Set.of("p2")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) {
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,7 +25,7 @@ /* * @test - * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module. + * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in unnamed module. * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module @@ -50,10 +50,10 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// package p1 in m1 is exported unqualifiedly +// ClassLoader1 --> defines m1x --> packages p1 +// package p1 in m1x is exported unqualifiedly // -// class p1.c1 defined in m1 tries to access p2.c2 defined in +// class p1.c1 defined in m1x tries to access p2.c2 defined in // in unnamed module. // // Three access attempts occur in this test: @@ -62,7 +62,7 @@ // 2. In this scenario a strict module establishes readability // to the particular unnamed module it is trying to access. // Access is allowed. -// 3. Module m1 in the test_looseModuleLayer() method +// 3. Module m1x in the test_looseModuleLayer() method // is transitioned to a loose module, access // to all unnamed modules is allowed. // @@ -71,41 +71,41 @@ // Create Layers over the boot layer to test different // accessing scenarios of a named module to an unnamed module. - // Module m1 is a strict module and has not established + // Module m1x is a strict module and has not established // readability to an unnamed module that p2.c2 is defined in. public void test_strictModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -114,109 +114,109 @@ // Attempt access try { p1_c1_class.newInstance(); - throw new RuntimeException("Test Failed, strict module m1 should not be able " + + throw new RuntimeException("Test Failed, strict module m1x should not be able " + "to access public type p2.c2 defined in unnamed module"); } catch (IllegalAccessError e) { } } - // Module m1 is a strict module and has established + // Module m1x is a strict module and has established // readability to an unnamed module that p2.c2 is defined in. public void test_strictModuleUnnamedReadableLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1ReadEdgeDiffLoader Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1ReadEdgeDiffLoader"); try { - // Read edge between m1 and the unnamed module that loads p2.c2 is established in + // Read edge between m1x and the unnamed module that loads p2.c2 is established in // c1ReadEdgeDiffLoader's ctor before attempting access. p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, module m1 has established readability to p2/c2 loader's " + + throw new RuntimeException("Test Failed, module m1x has established readability to p2/c2 loader's " + "unnamed module, access should be allowed: " + e.getMessage()); } } - // Module m1 is a loose module and thus can read all unnamed modules. + // Module m1x is a loose module and thus can read all unnamed modules. public void test_looseModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1Loose Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1Loose"); - // change m1 to read all unnamed modules - Module m1 = layer.findModule("m1").get(); - jdk.internal.module.Modules.addReadsAllUnnamed(m1); + // change m1x to read all unnamed modules + Module m1x = layer.findModule("m1x").get(); + jdk.internal.module.Modules.addReadsAllUnnamed(m1x); try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, loose module m1 should be able to access " + + throw new RuntimeException("Test Failed, loose module m1x should be able to access " + "public type p2.c2 defined in unnamed module: " + e.getMessage()); } }
--- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,7 +25,7 @@ /* * @test - * @summary class p3.c3 defined in module m1 tries to access c4 defined in an unnamed package + * @summary class p3.c3 defined in module m1x tries to access c4 defined in an unnamed package * and an unnamed module. * @modules java.base/jdk.internal.misc * @library /test/lib @@ -48,10 +48,10 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p3 -// package p3 in m1 is exported unqualifiedly +// ClassLoader1 --> defines m1x --> packages p3 +// package p3 in m1x is exported unqualifiedly // -// class p3.c3 defined in m1 tries to access c4 defined in +// class p3.c3 defined in m1x tries to access c4 defined in // in unnamed module. // // Two access attempts occur in this test: @@ -66,41 +66,41 @@ // Create Layers over the boot layer to test different // accessing scenarios of a named module to an unnamed module. - // Module m1 is a strict module and has not established + // Module m1x is a strict module and has not established // readability to an unnamed module that c4 is defined in. public void test_strictModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p3 // Packages exported: p3 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p3") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p3.c3 @@ -109,58 +109,58 @@ // Attempt access try { p3_c3_class.newInstance(); - throw new RuntimeException("Test Failed, strict module m1 should not be able to access " + + throw new RuntimeException("Test Failed, strict module m1x should not be able to access " + "public type c4 defined in unnamed module"); } catch (IllegalAccessError e) { } } - // Module m1 is a strict module and has established + // Module m1x is a strict module and has established // readability to an unnamed module that c4 is defined in. public void test_strictModuleUnnamedReadableLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p3 // Packages exported: p3 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p3") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p3.c3ReadEdgeDiffLoader Class p3_c3_class = MyDiffClassLoader.loader1.loadClass("p3.c3ReadEdgeDiffLoader"); try { - // Read edge between m1 and the unnamed module that loads c4 is established in + // Read edge between m1x and the unnamed module that loads c4 is established in // C3ReadEdgeDiffLoader's ctor before attempting access. p3_c3_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, module m1 has established readability to " + + throw new RuntimeException("Test Failed, module m1x has established readability to " + "c4 loader's unnamed module, access should be allowed: " + e.getMessage()); } }
--- a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,9 +25,9 @@ /* * @test - * @summary Test that if module m1 can read module m2, but package p2 in m2 - * is exported specifically to module m3, then class p1.c1 in m1 can not - * access p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, but package p2 in m2x + * is exported specifically to module m3x, then class p1.c1 in m1x can not + * access p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -48,15 +48,15 @@ import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can read m2 -// package p2 in m2 is exported to m3 +// m1x can read m2x +// package p2 in m2x is exported to m3x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access denied since although m1 can read m2, p2 is exported only to m3. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access denied since although m1x can read m2x, p2 is exported only to m3x. // public class ExpQualOther { @@ -65,66 +65,66 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2, m3 + // Define module: m1x + // Can read: java.base, m2x, m3x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") - .requires("m3") + .requires("m2x") + .requires("m3x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported to m3 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m3x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m3")) + .exports("p2", Set.of("m3x")) .build(); - // Define module: m3 - // Can read: java.base, m2 + // Define module: m3x + // Can read: java.base, m2x // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") - .requires("m2") - .contains("p3") + .requires("m2x") + .packages(Set.of("p3")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); - map.put("m3", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); + map.put("m3x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // 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("Failed to get IAE (p2 in m2 is exported to m3 not to m1)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x not to m1x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) {
--- a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, AND package p2 in m2 is - * exported qualifiedly to m1, then class p1.c1 in m1 can read p2.c2 in m2. + * @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. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -53,52 +53,52 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported qualifiedly to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported qualifiedly to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .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("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + 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(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1"); + throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x"); } }
--- a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, AND package p2 in module2 is - * exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, AND package p2 in module_two is + * exported unqualifiedly, then class p1.c1 in m1x can read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -53,45 +53,45 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: p2 is exported unqualifiedly - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") .exports("p2") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .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("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + 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");
--- a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary Test if package p2 in module m2 is exported to all unnamed, - * then class p1.c1 in an unnamed module can read p2.c2 in module m2. + * @summary Test if package p2 in module m2x is exported to all unnamed, + * then class p1.c1 in an unnamed module can read p2.c2 in module m2x. * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module @@ -49,15 +49,15 @@ import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported unqualifiedly +// m1x can read m2x +// package p2 in m2x is exported unqualifiedly // -// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x // Access allowed, an unnamed module can read all modules and p2 in module -// m2 is exported to all unnamed modules. +// m2x is exported to all unnamed modules. public class ExportAllUnnamed { @@ -66,51 +66,51 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: p2 is exported unqualifiedly - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); Class p2_c2_class = MySameClassLoader.loader1.loadClass("p2.c2"); - Module m2 = p2_c2_class.getModule(); + Module m2x = p2_c2_class.getModule(); - // Export m2/p2 to all unnamed modules. - jdk.internal.module.Modules.addExportsToAllUnnamed(m2, "p2"); + // Export m2x/p2 to all unnamed modules. + jdk.internal.module.Modules.addExportsToAllUnnamed(m2x, "p2"); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1");
--- a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, but package p2 in m2 is not - * exported, then class p1.c1 in m1 can not read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, but package p2 in m2x is not + * exported, then class p1.c1 in m1x can not read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -47,13 +47,13 @@ import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x // Access denied since p2 is not exported. // public class PkgNotExp { @@ -63,51 +63,51 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p2") + .packages(Set.of("p2")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .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("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 and m2 + // Create Layer that contains m1x and m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + 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("Failed to get IAE (p2 in m2 is not exported)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) {
--- a/hotspot/test/runtime/modules/AccessCheck/Umod.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/Umod.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,7 +25,7 @@ /* * @test - * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module. + * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in unnamed module. * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module @@ -50,10 +50,10 @@ import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// package p1 in m1 is exported unqualifiedly +// ClassLoader1 --> defines m1x --> packages p1 +// package p1 in m1x is exported unqualifiedly // -// class p1.c1 defined in m1 tries to access p2.c2 defined in +// class p1.c1 defined in m1x tries to access p2.c2 defined in // in unnamed module. // // Three access attempts occur in this test: @@ -62,7 +62,7 @@ // 2. In this scenario a strict module establishes readability // to the particular unnamed module it is trying to access. // Access is allowed. -// 3. Module m1 in the test_looseModuleLayer() method +// 3. Module m1x in the test_looseModuleLayer() method // is transitioned to a loose module, access // to all unnamed modules is allowed. // @@ -71,38 +71,38 @@ // Create Layers over the boot layer to test different // accessing scenarios of a named module to an unnamed module. - // Module m1 is a strict module and has not established + // Module m1x is a strict module and has not established // readability to an unnamed module that p2.c2 is defined in. public void test_strictModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader. MySameClassLoader loader = new MySameClassLoader(); Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -111,103 +111,103 @@ // Attempt access try { p1_c1_class.newInstance(); - throw new RuntimeException("Test Failed, strict module m1, type p1.c1, should not be able " + + throw new RuntimeException("Test Failed, strict module m1x, type p1.c1, should not be able " + "to access public type p2.c2 defined in unnamed module"); } catch (IllegalAccessError e) { } } - // Module m1 is a strict module and has established + // Module m1x is a strict module and has established // readability to an unnamed module that p2.c2 is defined in. public void test_strictModuleUnnamedReadableLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MySameClassLoader loader = new MySameClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader. Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1ReadEdge Class p1_c1_class = loader.loadClass("p1.c1ReadEdge"); try { - // Read edge between m1 and the unnamed module that loads p2.c2 is established in + // Read edge between m1x and the unnamed module that loads p2.c2 is established in // c1ReadEdge's ctor before attempting access. p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, strict module m1, type p1.c1ReadEdge, should be able to acccess public type " + + throw new RuntimeException("Test Failed, strict module m1x, type p1.c1ReadEdge, should be able to acccess public type " + "p2.c2 defined in unnamed module: " + e.getMessage()); } } - // Module m1 is a loose module and thus can read all unnamed modules. + // Module m1x is a loose module and thus can read all unnamed modules. public void test_looseModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MySameClassLoader loader = new MySameClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader. Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1Loose Class p1_c1_class = loader.loadClass("p1.c1Loose"); - // change m1 to read all unnamed modules - Module m1 = layer.findModule("m1").get(); - jdk.internal.module.Modules.addReadsAllUnnamed(m1); + // change m1x to read all unnamed modules + Module m1x = layer.findModule("m1x").get(); + jdk.internal.module.Modules.addReadsAllUnnamed(m1x); try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, strict module m1, type p1.c1Loose, should be able to acccess public type " + + throw new RuntimeException("Test Failed, strict module m1x, type p1.c1Loose, should be able to acccess public type " + "p2.c2 defined in unnamed module: " + e.getMessage()); } }
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,9 +25,9 @@ /* * @test - * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2. + * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x. * Access is denied, since an unnamed module can read all modules but p2 in module - * m2 is exported specifically to module m1, not to all modules. + * m2x is exported specifically to module m1x, not to all modules. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -48,15 +48,15 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x // Access denied, an unnamed module can read all modules but p2 in module -// m2 is exported specifically to module m1 not to all modules. +// m2x is exported specifically to module m1x not to all modules. // public class UmodDiffCL_ExpQualOther { @@ -65,53 +65,53 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 - // NOTE: module m1 does not define a package named p1. + // NOTE: module m1x does not define a package named p1. // p1 will be loaded in an unnamed module. Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1, not unqualifiedly"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x, not unqualifiedly"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) {
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2. - * Access allowed, an unnamed module can read all modules and p2 in module m2 + * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x. + * Access allowed, an unnamed module can read all modules and p2 in module m2x * which is exported unqualifiedly. * @modules java.base/jdk.internal.misc * @library /test/lib @@ -48,15 +48,15 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported unqualifiedly. +// m1x can read m2x +// package p2 in m2x is exported unqualifiedly. // -// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x // Access allowed, an unnamed module can read all modules and p2 in module -// m2 which is exported unqualifiedly. +// m2x which is exported unqualifiedly. // public class UmodDiffCL_ExpUnqual { @@ -65,53 +65,53 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") .exports("p2") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); - // NOTE: module m1 does not define a package named p1. + // NOTE: module m1x does not define a package named p1. // p1 will be loaded in an unnamed module. Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, p1.c1 defined in unnamed module can access p2.c2 in module m2"); + throw new RuntimeException("Test Failed, p1.c1 defined in unnamed module can access p2.c2 in module m2x"); } }
--- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,9 +25,9 @@ /* * @test - * @summary class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2. + * @summary class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2x. * Access is denied since even though unnamed module can read all modules, p2 - * in module m2 is not exported at all. + * in module m2x is not exported at all. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -47,15 +47,15 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2x // Access denied since even though unnamed module can read all modules, p2 -// in module m2 is not exported at all. +// in module m2x is not exported at all. // public class UmodDiffCL_PkgNotExp { @@ -64,53 +64,53 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p2") + .packages(Set.of("p2")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 - // NOTE: module m1 does not define a package named p1. + // NOTE: module m1x does not define a package named p1. // p1 will be loaded in an unnamed module. Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported to an unnamed module)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported to an unnamed module)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) {
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,7 +25,7 @@ /* * @test - * @summary class p3.c3 defined in module m1 tries to access c4 defined in unnamed module. + * @summary class p3.c3 defined in module m1x tries to access c4 defined in unnamed module. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -48,10 +48,10 @@ import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p3 -// package p3 in m1 is exported unqualifiedly +// ClassLoader1 --> defines m1x --> packages p3 +// package p3 in m1x is exported unqualifiedly // -// class p3.c3 defined in m1 tries to access c4 defined in +// class p3.c3 defined in m1x tries to access c4 defined in // in unnamed module. // // Two access attempts occur in this test: @@ -66,38 +66,38 @@ // Create Layers over the boot layer to test different // accessing scenarios of a named module to an unnamed module. - // Module m1 is a strict module and has not established + // Module m1x is a strict module and has not established // readability to an unnamed module that c4 is defined in. public void test_strictModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p3 // Packages exported: p3 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p3") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); - // map module m1 to class loader. + // map module m1x to class loader. // class c4 will be loaded in an unnamed module/loader. MySameClassLoader loader = new MySameClassLoader(); Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p3.c3 @@ -106,55 +106,55 @@ // Attempt access try { p3_c3_class.newInstance(); - throw new RuntimeException("Test Failed, strict module m1, type p3.c3, should not be able to access " + + throw new RuntimeException("Test Failed, strict module m1x, type p3.c3, should not be able to access " + "public type c4 defined in unnamed module"); } catch (IllegalAccessError e) { } } - // Module m1 is a strict module and has established + // Module m1x is a strict module and has established // readability to an unnamed module that c4 is defined in. public void test_strictModuleUnnamedReadableLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p3 // Packages exported: p3 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p3") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MySameClassLoader loader = new MySameClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c4 will be loaded in an unnamed module/loader. Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 + // Create Layer that contains m1x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p3.c3ReadEdge Class p3_c3_class = loader.loadClass("p3.c3ReadEdge"); try { - // Read edge between m1 and the unnamed module that loads c4 is established in + // Read edge between m1x and the unnamed module that loads c4 is established in // c3ReadEdge's ctor before attempting access. p3_c3_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, module m1, type p3.c3ReadEdge, has established readability to " + + throw new RuntimeException("Test Failed, module m1x, type p3.c3ReadEdge, has established readability to " + "c4 loader's unnamed module, access should be allowed: " + e.getMessage()); } }
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,9 +25,9 @@ /* * @test - * @summary class c5 defined in an unnamed module tries to access p6.c6 defined in m2. + * @summary class c5 defined in an unnamed module tries to access p6.c6 defined in m2x. * Access is denied, since an unnamed module can read all modules but p6 in module - * m2 is exported specifically to module m1, not to all modules. + * m2x is exported specifically to module m1x, not to all modules. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -48,15 +48,15 @@ import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p6 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p6 // -// m1 can read m2 -// package p6 in m2 is not exported +// m1x can read m2x +// package p6 in m2x is not exported // -// class c5 defined in an unnamed module tries to access p6.c6 defined in m2 +// class c5 defined in an unnamed module tries to access p6.c6 defined in m2x // Access denied, an unnamed module can read all modules but p6 in module -// m2 is exported specifically to module m1 not to all modules. +// m2x is exported specifically to module m1x not to all modules. // public class UmodUpkgDiffCL_ExpQualOther { @@ -65,51 +65,51 @@ // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p6 - // Packages exported: p6 exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p6 exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p6", Set.of("m1")) + .exports("p6", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" + // Resolves "m1x" Configuration cf = Layer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map<String, ClassLoader> map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 + // Create Layer that contains m1x & m2x Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class c5 Class c5_class = MyDiffClassLoader.loader1.loadClass("c5"); try { c5_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p6 in m2 is exported to m1, not unqualifiedly"); + throw new RuntimeException("Failed to get IAE (p6 in m2x is exported to m1x, not unqualifiedly"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) {
--- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java Thu Mar 09 21:35:20 2017 +0000 +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java Mon Mar 13 19:58:38 2017 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -25,8 +25,8 @@ /* * @test - * @summary class c5 in an unnamed module can read module m2, but package p6 in module m2 is not exported. - * Access denied since even though unnamed module can read all modules, p6 in module m2 is not e