diff --git a/.hgtags b/.hgtags index ce61a561609..b013607d06a 100644 --- a/.hgtags +++ b/.hgtags @@ -631,3 +631,4 @@ dd5198db2e5b1ebcafe065d987c03ba9fcb50fc3 jdk-15+17 44aef192b488a48cce12422394691a6b1d16b98e jdk-15+18 7cc27caabe6e342151e8baf549beb07a9c755ec2 jdk-15+19 46bca5e5e6fb26efd07245d26fe96a9c3260f51e jdk-15+20 +12b55fad80f30d24b1f8fdb3b947ea6465ef9518 jdk-15+21 diff --git a/bin/idea.sh b/bin/idea.sh index eedd138fdde..ca674e2925d 100644 --- a/bin/idea.sh +++ b/bin/idea.sh @@ -197,13 +197,15 @@ CP=$ANT_HOME/lib/ant.jar rm -rf $CLASSES; mkdir $CLASSES if [ "x$CYGPATH" = "x" ] ; then ## CYGPATH may be set in env.cfg - JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/JdkIdeaAntLogger.java + JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java + JAVAC_SOURCE_PATH=$IDEA_OUTPUT/src JAVAC_CLASSES=$CLASSES JAVAC_CP=$CP else - JAVAC_SOURCE_FILE=`cygpath -am $IDEA_OUTPUT/src/idea/JdkIdeaAntLogger.java` + JAVAC_SOURCE_FILE=`cygpath -am $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java` + JAVAC_SOURCE_PATH=`cygpath -am $IDEA_OUTPUT/src` JAVAC_CLASSES=`cygpath -am $CLASSES` JAVAC_CP=`cygpath -am $CP` fi -$BOOT_JDK/bin/javac -d $JAVAC_CLASSES -cp $JAVAC_CP $JAVAC_SOURCE_FILE +$BOOT_JDK/bin/javac -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC_CP $JAVAC_SOURCE_FILE diff --git a/doc/building.html b/doc/building.html index 36da52360f0..d715086f69b 100644 --- a/doc/building.html +++ b/doc/building.html @@ -578,7 +578,7 @@

Advanced Make Control Variables

Running Tests

Most of the JDK tests are using the JTReg test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the --with-jtreg=<path to jtreg home> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing lib/jtreg.jar etc.

-

The Adoption Group provides recent builds of jtreg here. Download the latest .tar.gz file, unpack it, and point --with-jtreg to the jtreg directory that you just unpacked.

+

The Adoption Group provides recent builds of jtreg here. Download the latest .tar.gz file, unpack it, and point --with-jtreg to the jtreg directory that you just unpacked.

To execute the most basic tests (tier 1), use:

make run-test-tier1

For more details on how to run tests, please see the Testing the JDK document.

diff --git a/doc/building.md b/doc/building.md index 041cb0fe5ea..32069933ec5 100644 --- a/doc/building.md +++ b/doc/building.md @@ -891,7 +891,7 @@ containing `lib/jtreg.jar` etc. The [Adoption Group](https://wiki.openjdk.java.net/display/Adoption) provides recent builds of jtreg [here]( -https://adopt-openjdk.ci.cloudbees.com/job/jtreg/lastSuccessfulBuild/artifact). +https://ci.adoptopenjdk.net/view/Dependencies/job/jtreg/lastSuccessfulBuild/artifact). Download the latest `.tar.gz` file, unpack it, and point `--with-jtreg` to the `jtreg` directory that you just unpacked. diff --git a/doc/testing.html b/doc/testing.html index bb7974cac60..c4ad9e6c40c 100644 --- a/doc/testing.html +++ b/doc/testing.html @@ -56,7 +56,7 @@

Using "make test" (the $ make test-jdk_lang JTREG="JOBS=8" $ make test TEST=jdk_lang $ make test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1" -$ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTOR=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug" +$ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTOR=8;JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug" $ make test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java" $ make test TEST="micro:java.lang.reflect" MICRO="FORK=1;WARMUP_ITER=2" $ make exploded-test TEST=tier2 @@ -106,8 +106,8 @@

Test results and summary

Test suite control

It is possible to control various aspects of the test suites using make control variables.

These variables use a keyword=value approach to allow multiple values to be set. So, for instance, JTREG="JOBS=1;TIMEOUT_FACTOR=8" will set the JTReg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting JTREG_JOBS=1 JTREG_TIMEOUT_FACTOR=8, but using the keyword format means that the JTREG variable is parsed and verified for correctness, so JTREG="TMIEOUT_FACTOR=8" would give an error, while JTREG_TMIEOUT_FACTOR=8 would just pass unnoticed.

-

To separate multiple keyword=value pairs, use ; (semicolon). Since the shell normally eats ;, the recommended usage is to write the assignment inside qoutes, e.g. JTREG="...;...". This will also make sure spaces are preserved, as in JTREG="VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug".

-

(Other ways are possible, e.g. using backslash: JTREG=JOBS=1\;TIMEOUT_FACTOR=8. Also, as a special technique, the string %20 will be replaced with space for certain options, e.g. JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)

+

To separate multiple keyword=value pairs, use ; (semicolon). Since the shell normally eats ;, the recommended usage is to write the assignment inside qoutes, e.g. JTREG="...;...". This will also make sure spaces are preserved, as in JTREG="JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug".

+

(Other ways are possible, e.g. using backslash: JTREG=JOBS=1\;TIMEOUT_FACTOR=8. Also, as a special technique, the string %20 will be replaced with space for certain options, e.g. JTREG=JAVA_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)

As far as possible, the names of the keywords have been standardized between test suites.

General keywords (TEST_OPTS)

Some keywords are valid across different test suites. If you want to run tests from multiple test suites, or just don't want to care which test suite specific control variable to use, then you can use the general TEST_OPTS control variable.

@@ -116,16 +116,16 @@

JOBS

Currently only applies to JTReg.

TIMEOUT_FACTOR

Currently only applies to JTReg.

-

VM_OPTIONS

-

Applies to JTReg, GTest and Micro.

JAVA_OPTIONS

Applies to JTReg, GTest and Micro.

+

VM_OPTIONS

+

Applies to JTReg, GTest and Micro.

AOT_MODULES

Applies to JTReg and GTest.

JCOV

This keywords applies globally to the test runner system. If set to true, it enables JCov coverage reporting for all tests run. To be useful, the JDK under test must be run with a JDK built with JCov instrumentation (configure --with-jcov=<path to directory containing lib/jcov.jar>, make jcov-image).

The simplest way to run tests with JCov coverage report is to use the special target jcov-test instead of test, e.g. make jcov-test TEST=jdk_lang. This will make sure the JCov image is built, and that JCov reporting is enabled.

-

The JCov report is stored in build/$BUILD/test-results/jcov-output.

+

The JCov report is stored in build/$BUILD/test-results/jcov-output/report.

Please note that running with JCov reporting can be very memory intensive.

JCOV_DIFF_CHANGESET

While collecting code coverage with JCov, it is also possible to find coverage for only recently changed code. JCOV_DIFF_CHANGESET specifies a source revision. A textual report will be generated showing coverage of the diff between the specified revision and the repository tip.

@@ -166,9 +166,10 @@

OPTIONS

Additional options to the JTReg test framework.

Use JTREG="OPTIONS=--help all" to see all available JTReg options.

JAVA_OPTIONS

-

Additional Java options to JTReg (-javaoption).

+

Additional Java options for running test classes (sent to JTReg as -javaoption).

VM_OPTIONS

-

Additional VM options to JTReg (-vmoption).

+

Additional Java options to be used when compiling and running classes (sent to JTReg as -vmoption).

+

This option is only needed in special circumstances. To pass Java options to your test classes, use JAVA_OPTIONS.

AOT_MODULES

Generate AOT modules before testing for the specified module, or set of modules. If multiple modules are specified, they should be separated by space (or, to help avoid quoting issues, the special value %20).

RETRY_COUNT

diff --git a/doc/testing.md b/doc/testing.md index f3d2a9e2993..31d45d0a339 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -23,7 +23,7 @@ Some example command-lines: $ make test-jdk_lang JTREG="JOBS=8" $ make test TEST=jdk_lang $ make test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1" - $ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTOR=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug" + $ make test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT_FACTOR=8;JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug" $ make test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java" $ make test TEST="micro:java.lang.reflect" MICRO="FORK=1;WARMUP_ITER=2" $ make exploded-test TEST=tier2 @@ -190,11 +190,11 @@ pass unnoticed. To separate multiple keyword=value pairs, use `;` (semicolon). Since the shell normally eats `;`, the recommended usage is to write the assignment inside qoutes, e.g. `JTREG="...;..."`. This will also make sure spaces are preserved, -as in `JTREG="VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"`. +as in `JTREG="JAVA_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"`. (Other ways are possible, e.g. using backslash: `JTREG=JOBS=1\;TIMEOUT_FACTOR=8`. Also, as a special technique, the string `%20` will be replaced with space for -certain options, e.g. `JTREG=VM_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug`. +certain options, e.g. `JTREG=JAVA_OPTIONS=-XshowSettings%20-Xlog:gc+ref=debug`. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.) @@ -218,11 +218,11 @@ Currently only applies to JTReg. Currently only applies to JTReg. -#### VM_OPTIONS +#### JAVA_OPTIONS Applies to JTReg, GTest and Micro. -#### JAVA_OPTIONS +#### VM_OPTIONS Applies to JTReg, GTest and Micro. @@ -250,7 +250,7 @@ Please note that running with JCov reporting can be very memory intensive. While collecting code coverage with JCov, it is also possible to find coverage for only recently changed code. JCOV_DIFF_CHANGESET specifies a source revision. A textual report will be generated showing coverage of the diff -between the specified revision and the repository tip. +between the specified revision and the repository tip. The report is stored in `build/$BUILD/test-results/jcov-output/diff_coverage_report` file. @@ -331,10 +331,15 @@ Additional options to the JTReg test framework. Use `JTREG="OPTIONS=--help all"` to see all available JTReg options. #### JAVA_OPTIONS -Additional Java options to JTReg (`-javaoption`). +Additional Java options for running test classes (sent to JTReg as +`-javaoption`). #### VM_OPTIONS -Additional VM options to JTReg (`-vmoption`). +Additional Java options to be used when compiling and running classes (sent to +JTReg as `-vmoption`). + +This option is only needed in special circumstances. To pass Java options to +your test classes, use `JAVA_OPTIONS`. #### AOT_MODULES diff --git a/make/CompileDemos.gmk b/make/CompileDemos.gmk index 07ebab467db..36c56ab6058 100644 --- a/make/CompileDemos.gmk +++ b/make/CompileDemos.gmk @@ -33,7 +33,6 @@ include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk include NativeCompilation.gmk -include SetupJavaCompilers.gmk include TextFileProcessing.gmk include ZipArchive.gmk @@ -93,7 +92,6 @@ COPY_TO_IMAGE := *.html *.txt *.png *.xml README* # EXTRA_COPY_TO_IMAGE Additional files to copy to images (as wildcards) # EXTRA_MANIFEST_ATTR Extra manifest attribute # SKIP_COMPILATION Skip Java compilation iff true -# DISABLE_SJAVAC Passed to SetupJavaCompilation # DISABLED_WARNINGS Additional disabled warnings SetupBuildDemo = $(NamedParamsMacroTemplate) define SetupBuildDemoBody @@ -126,7 +124,7 @@ define SetupBuildDemoBody ifneq ($$($1_SKIP_COMPILATION), true) $$(eval $$(call SetupJavaCompilation, BUILD_DEMO_$1, \ - SETUP := GENERATE_USINGJDKBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \ BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/$$($1_DEMO_SUBDIR)/$1, \ COPY := $(COPY_TO_JAR) $$($1_EXTRA_COPY_TO_JAR), \ @@ -137,7 +135,6 @@ define SetupBuildDemoBody SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \ EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \ DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \ - DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \ )) $1 += $$(BUILD_DEMO_$1) @@ -183,7 +180,6 @@ $(eval $(call SetupBuildDemo, SwingSet2, \ EXTRA_COPY_TO_JAR := .java, \ EXTRA_MANIFEST_ATTR := SplashScreen-Image: resources/images/splash.png, \ DISABLED_WARNINGS := rawtypes deprecation unchecked static serial cast, \ - DISABLE_SJAVAC := true, \ )) $(eval $(call SetupBuildDemo, Font2DTest, \ diff --git a/make/CompileInterimLangtools.gmk b/make/CompileInterimLangtools.gmk index 3abdded8ee8..88578e3e060 100644 --- a/make/CompileInterimLangtools.gmk +++ b/make/CompileInterimLangtools.gmk @@ -29,7 +29,6 @@ default: all include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk include Modules.gmk ################################################################################ @@ -66,8 +65,8 @@ TARGETS += $(COPY_PREVIEW_FEATURES) # Param 1 - Name of module to compile define SetupInterimModule $$(eval $$(call SetupJavaCompilation, BUILD_$1.interim, \ - SETUP := BOOT_JAVAC, \ - DISABLE_SJAVAC := true, \ + COMPILER := bootjdk, \ + TARGET_RELEASE := $$(TARGET_RELEASE_BOOTJDK), \ SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \ $$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \ $(TOPDIR)/src/$1/share/classes, \ @@ -77,8 +76,9 @@ define SetupInterimModule EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \ COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \ BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \ - DISABLED_WARNINGS := module, \ - ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \ + DISABLED_WARNINGS := module options, \ + JAVAC_FLAGS := \ + --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \ $$(INTERIM_LANGTOOLS_ADD_EXPORTS) \ --patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \ --add-exports java.base/jdk.internal=java.compiler.interim \ diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index af6285d2755..9b63118710d 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -30,7 +30,6 @@ include $(SPEC) include MakeBase.gmk include Modules.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk # Hook to include the corresponding custom file, if present. $(eval $(call IncludeCustomExtension, CompileJavaModules.gmk)) @@ -38,8 +37,11 @@ $(eval $(call IncludeCustomExtension, CompileJavaModules.gmk)) ################################################################################ # Module specific build settings -java.base_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*' -XDstringConcat=inline -java.base_COPY += .icu .dat .spp .nrm content-types.properties hijrah-config-Hijrah-umalqura_islamic-umalqura.properties +java.base_DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \ + '-Xdoclint/package:java.*,javax.*' +java.base_JAVAC_FLAGS += -XDstringConcat=inline +java.base_COPY += .icu .dat .spp .nrm content-types.properties \ + hijrah-config-Hijrah-umalqura_islamic-umalqura.properties java.base_CLEAN += intrinsic.properties java.base_EXCLUDE_FILES += \ @@ -70,18 +72,19 @@ endif ################################################################################ -java.compiler_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' +java.compiler_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:java.*,javax.*' ################################################################################ -java.datatransfer_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' +java.datatransfer_DOCLINT += -Xdoclint:all/protected,-reference \ + '-Xdoclint/package:java.*,javax.*' java.datatransfer_COPY += flavormap.properties ################################################################################ -java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference \ - '-Xdoclint/package:java.*,javax.*' \ - --doclint-format html4 +java.desktop_DOCLINT += -Xdoclint:all/protected,-reference \ + '-Xdoclint/package:java.*,javax.*' java.desktop_COPY += .gif .png .wav .txt .xml .css .pf java.desktop_CLEAN += iio-plugin.properties cursors.properties @@ -214,75 +217,89 @@ java.desktop_EXCLUDE_FILES += \ ################################################################################ -java.scripting_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' +java.scripting_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:java.*,javax.*' java.scripting_COPY += .js java.scripting_CLEAN += .properties ################################################################################ -java.instrument_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' +java.instrument_DOCLINT += -Xdoclint:all/protected,-accessibility \ + '-Xdoclint/package:java.*,javax.*' ################################################################################ -java.logging_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*' +java.logging_DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \ + '-Xdoclint/package:java.*,javax.*' ################################################################################ -java.management_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference,-accessibility '-Xdoclint/package:java.*,javax.*' +java.management_DOCLINT += -Xdoclint:all/protected,-reference,-accessibility \ + '-Xdoclint/package:java.*,javax.*' ################################################################################ -java.management.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:javax.*' +java.management.rmi_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:javax.*' ################################################################################ -java.prefs_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' +java.prefs_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:java.*,javax.*' ################################################################################ -java.transaction.xa_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:javax.*' +java.transaction.xa_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:javax.*' ################################################################################ -java.sql_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' +java.sql_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:java.*,javax.*' ################################################################################ -java.sql.rowset_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' +java.sql.rowset_DOCLINT += -Xdoclint:all/protected,-accessibility \ + '-Xdoclint/package:java.*,javax.*' java.sql.rowset_CLEAN_FILES += $(wildcard \ $(TOPDIR)/src/java.sql.rowset/share/classes/com/sun/rowset/*.properties \ $(TOPDIR)/src/java.sql.rowset/share/classes/javax/sql/rowset/*.properties) ################################################################################ -java.rmi_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' +java.rmi_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:java.*,javax.*' java.rmi_CLEAN_FILES += $(wildcard \ $(TOPDIR)/src/java.rmi/share/classes/sun/rmi/registry/resources/*.properties \ $(TOPDIR)/src/java.rmi/share/classes/sun/rmi/server/resources/*.properties) ################################################################################ -java.xml_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility \ +java.xml_DOCLINT += -Xdoclint:all/protected,-accessibility \ '-Xdoclint/package:$(call CommaList, javax.xml.catalog javax.xml.datatype \ javax.xml.transform javax.xml.validation javax.xml.xpath)' java.xml_CLEAN += .properties ################################################################################ -java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' +java.naming_DOCLINT += -Xdoclint:all/protected,-accessibility \ + '-Xdoclint/package:java.*,javax.*' java.naming_CLEAN += jndiprovider.properties ################################################################################ -java.security.jgss_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' +java.security.jgss_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:java.*,javax.*' ################################################################################ -java.smartcardio_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' +java.smartcardio_DOCLINT += -Xdoclint:all/protected,-accessibility \ + '-Xdoclint/package:java.*,javax.*' ################################################################################ -java.xml.crypto_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*' +java.xml.crypto_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:java.*,javax.*' java.xml.crypto_COPY += .dtd .xml java.xml.crypto_CLEAN += .properties @@ -294,9 +311,9 @@ jdk.charsets_COPY += .dat ################################################################################ -jdk.compiler_ADD_JAVAC_FLAGS += -Xdoclint:all/protected \ - '-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*,sun.tools.serialver.resources.*' \ - -XDstringConcat=inline +jdk.compiler_DOCLINT += -Xdoclint:all/protected \ + '-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*,sun.tools.serialver.resources.*' +jdk.compiler_JAVAC_FLAGS += -XDstringConcat=inline jdk.compiler_CLEAN_FILES += $(wildcard \ $(patsubst %, $(TOPDIR)/src/jdk.compiler/share/classes/%/*.properties, \ sun/tools/serialver/resources)) @@ -337,17 +354,7 @@ jdk.javadoc_COPY += .xml .css .js .png ################################################################################ -jdk.jartool_ADD_JAVAC_FLAGS += -XDstringConcat=inline - -################################################################################ - -jdk.scripting.nashorn_DISABLED_WARNINGS += removal -jdk.scripting.nashorn_COPY := .properties .js - -################################################################################ - -jdk.scripting.nashorn.shell_DISABLED_WARNINGS += removal -jdk.scripting.nashorn.shell_COPY += .js .properties +jdk.jartool_JAVAC_FLAGS += -XDstringConcat=inline ################################################################################ @@ -375,8 +382,9 @@ endif ################################################################################ -jdk.incubator.jpackage_COPY += .gif .png .txt .spec .script .prerm .preinst .postrm .postinst .list .sh \ - .desktop .copyright .control .plist .template .icns .scpt .entitlements .wxs .wxl .wxi .ico .bmp .tiff +jdk.incubator.jpackage_COPY += .gif .png .txt .spec .script .prerm .preinst \ + .postrm .postinst .list .sh .desktop .copyright .control .plist .template \ + .icns .scpt .entitlements .wxs .wxl .wxi .ico .bmp .tiff jdk.incubator.jpackage_CLEAN += .properties @@ -430,11 +438,11 @@ jdk.incubator.jextract_COPY += .properties .template # The exports are needed since JVMCI is dynamically exported (see # jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo). -jdk.internal.vm.ci_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline +jdk.internal.vm.ci_JAVAC_FLAGS += -parameters -XDstringConcat=inline ################################################################################ -jdk.internal.vm.compiler_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \ +jdk.internal.vm.compiler_JAVAC_FLAGS += -parameters -XDstringConcat=inline \ --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler \ --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler \ --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler \ @@ -468,6 +476,7 @@ jdk.internal.vm.compiler_EXCLUDES += \ org.graalvm.compiler.graph.test \ org.graalvm.compiler.hotspot.aarch64.test \ org.graalvm.compiler.hotspot.amd64.test \ + org.graalvm.compiler.hotspot.jdk15.test \ org.graalvm.compiler.hotspot.jdk9.test \ org.graalvm.compiler.hotspot.lir.test \ org.graalvm.compiler.hotspot.sparc.test \ @@ -502,7 +511,7 @@ jdk.internal.vm.compiler_EXCLUDES += \ # The exports are needed since JVMCI is dynamically exported (see # jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo). -jdk.aot_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline \ +jdk.aot_JAVAC_FLAGS += -parameters -XDstringConcat=inline \ --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler,jdk.aot \ --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler,jdk.aot \ --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler,jdk.aot \ @@ -537,7 +546,7 @@ jdk.localedata_KEEP_ALL_TRANSLATIONS := true jdk.jfr_DISABLED_WARNINGS += exports jdk.jfr_COPY := .xsd .xml .dtd -jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline +jdk.jfr_JAVAC_FLAGS := -XDstringConcat=inline ################################################################################ # If this is an imported module that has prebuilt classes, only compile @@ -600,7 +609,7 @@ ifeq ($(MODULE), jdk.aot) endif $(eval $(call SetupJavaCompilation, $(MODULE), \ - SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \ + SMALL_JAVA := false, \ MODULE := $(MODULE), \ SRC := $(wildcard $(MODULE_SRC_DIRS)), \ INCLUDES := $(JDK_USER_DEFINED_FILTER), \ @@ -608,8 +617,9 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \ BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \ HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \ CREATE_API_DIGEST := true, \ - ADD_JAVAC_FLAGS := \ - $($(MODULE)_ADD_JAVAC_FLAGS) \ + JAVAC_FLAGS := \ + $($(MODULE)_DOCLINT) \ + $($(MODULE)_JAVAC_FLAGS) \ --module-source-path $(MODULESOURCEPATH) \ --module-path $(MODULEPATH) \ --system none, \ diff --git a/make/CompileModuleTools.gmk b/make/CompileModuleTools.gmk index 8cc145e0b6c..c6322e5b36e 100644 --- a/make/CompileModuleTools.gmk +++ b/make/CompileModuleTools.gmk @@ -28,14 +28,13 @@ default: all include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk ################################################################################ TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes -$(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \ - SETUP := GENERATE_USINGJDKBYTECODE, \ +$(eval $(call SetupJavaCompilation, BUILD_JIGSAW_TOOLS, \ + TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ SRC := $(TOPDIR)/make/jdk/src/classes, \ INCLUDES := build/tools/deps \ build/tools/docs \ @@ -43,10 +42,10 @@ $(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \ COPY := .properties .html, \ BIN := $(TOOLS_CLASSES_DIR), \ DISABLED_WARNINGS := fallthrough, \ - ADD_JAVAC_FLAGS := \ + JAVAC_FLAGS := \ --add-modules jdk.jdeps \ --add-exports java.base/jdk.internal.module=ALL-UNNAMED \ - --add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \ + --add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED, \ )) TARGETS += $(BUILD_JIGSAW_TOOLS) diff --git a/make/CompileToolsHotspot.gmk b/make/CompileToolsHotspot.gmk index 645c785733e..30d00894430 100644 --- a/make/CompileToolsHotspot.gmk +++ b/make/CompileToolsHotspot.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk TARGETS := @@ -45,7 +44,7 @@ ifeq ($(INCLUDE_GRAAL), true) ############################################################################## # Compile the annotation processors $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_MATCH_PROCESSOR, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := \ $(SRC_DIR)/org.graalvm.compiler.processor/src \ $(SRC_DIR)/org.graalvm.compiler.core.match.processor/src \ @@ -53,6 +52,7 @@ ifeq ($(INCLUDE_GRAAL), true) EXCLUDE_FILES := $(EXCLUDE_FILES), \ BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor, \ JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.match.processor.jar, \ + DISABLED_WARNINGS := options, \ )) TARGETS += $(BUILD_VM_COMPILER_MATCH_PROCESSOR) @@ -60,13 +60,14 @@ ifeq ($(INCLUDE_GRAAL), true) ############################################################################## $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_NODEINFO_PROCESSOR, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := \ $(SRC_DIR)/org.graalvm.compiler.processor/src \ $(SRC_DIR)/org.graalvm.compiler.nodeinfo.processor/src \ , \ BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor, \ JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.nodeinfo.processor.jar, \ + DISABLED_WARNINGS := options, \ )) TARGETS += $(BUILD_VM_COMPILER_NODEINFO_PROCESSOR) @@ -74,7 +75,8 @@ ifeq ($(INCLUDE_GRAAL), true) ############################################################################## $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_OPTIONS_PROCESSOR, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ + DISABLED_WARNINGS := options, \ SRC := \ $(SRC_DIR)/org.graalvm.compiler.processor/src \ $(SRC_DIR)/org.graalvm.compiler.options.processor/src \ @@ -88,7 +90,7 @@ ifeq ($(INCLUDE_GRAAL), true) ############################################################################## $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := \ $(SRC_DIR)/org.graalvm.compiler.processor/src \ $(SRC_DIR)/org.graalvm.compiler.replacements.processor/src \ @@ -96,6 +98,7 @@ ifeq ($(INCLUDE_GRAAL), true) EXCLUDE_FILES := $(EXCLUDE_FILES), \ BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier, \ JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar, \ + DISABLED_WARNINGS := options, \ )) TARGETS += $(BUILD_VM_COMPILER_REPLACEMENTS_PROCESSOR) @@ -103,7 +106,7 @@ ifeq ($(INCLUDE_GRAAL), true) ############################################################################## $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := \ $(SRC_DIR)/org.graalvm.compiler.processor/src \ $(SRC_DIR)/org.graalvm.compiler.serviceprovider.processor/src \ @@ -111,6 +114,7 @@ ifeq ($(INCLUDE_GRAAL), true) EXCLUDE_FILES := $(EXCLUDE_FILES), \ BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor, \ JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor.jar, \ + DISABLED_WARNINGS := options, \ )) TARGETS += $(BUILD_VM_COMPILER_SERVICEPROVIDER_PROCESSOR) diff --git a/make/CompileToolsJdk.gmk b/make/CompileToolsJdk.gmk index 1cef5108f1a..367b60887a1 100644 --- a/make/CompileToolsJdk.gmk +++ b/make/CompileToolsJdk.gmk @@ -28,7 +28,6 @@ default: all include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk include TextFileProcessing.gmk ################################################################################ @@ -44,7 +43,7 @@ BUILD_TOOLS_SRC_DIRS += \ # $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := $(BUILD_TOOLS_SRC_DIRS), \ EXCLUDES := \ build/tools/classlist \ @@ -54,10 +53,10 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \ build/tools/depend \ , \ BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \ - ADD_JAVAC_FLAGS := \ + DISABLED_WARNINGS := options, \ + JAVAC_FLAGS := \ --add-exports java.desktop/sun.awt=ALL-UNNAMED \ - --add-exports java.base/sun.text=ALL-UNNAMED \ - , \ + --add-exports java.base/sun.text=ALL-UNNAMED, \ )) TARGETS += $(BUILD_TOOLS_JDK) @@ -72,10 +71,11 @@ TARGETS += $(COPY_NIMBUS_TEMPLATES) ################################################################################ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := $(TOPDIR)/make/jdk/src/classes, \ INCLUDES := build/tools/depend, \ BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \ + DISABLED_WARNINGS := options, \ )) DEPEND_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services/com.sun.source.util.Plugin diff --git a/make/GenerateLinkOptData.gmk b/make/GenerateLinkOptData.gmk index 8e2e0c11711..bc8d4f21e43 100644 --- a/make/GenerateLinkOptData.gmk +++ b/make/GenerateLinkOptData.gmk @@ -31,14 +31,14 @@ default: all include $(SPEC) include MakeBase.gmk -include SetupJavaCompilers.gmk +include JavaCompilation.gmk ################################################################################ # Create a jar with our generator class. Using a jar is intentional since it # will load more classes $(eval $(call SetupJavaCompilation, CLASSLIST_JAR, \ - SETUP := GENERATE_JDKBYTECODE, \ + SMALL_JAVA := false, \ SRC := $(TOPDIR)/make/jdk/src/classes, \ INCLUDES := build/tools/classlist, \ BIN := $(BUILDTOOLS_OUTPUTDIR)/classlist_classes, \ diff --git a/make/Images.gmk b/make/Images.gmk index 1e038eb4aa4..36a7e7317a3 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -85,6 +85,8 @@ ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true) JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods endif +JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator module" || test "$$?" = "1" ) + $(eval $(call SetupExecute, jlink_jdk, \ WARN := Creating jdk image, \ DEPS := $(JMODS) $(BASE_RELEASE_FILE) \ @@ -93,7 +95,8 @@ $(eval $(call SetupExecute, jlink_jdk, \ SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \ PRE_COMMAND := $(RM) -r $(JDK_IMAGE_DIR), \ COMMAND := $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \ - $(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR), \ + $(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR) \ + $(JLINK_DISABLE_WARNINGS), \ )) JLINK_JDK_TARGETS := $(jlink_jdk) diff --git a/make/JrtfsJar.gmk b/make/JrtfsJar.gmk index e35c8220cd0..1d7ee9a0860 100644 --- a/make/JrtfsJar.gmk +++ b/make/JrtfsJar.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ default: all include $(SPEC) include MakeBase.gmk +include JavaCompilation.gmk include JarArchive.gmk -include SetupJavaCompilers.gmk include TextFileProcessing.gmk # This rule will be depended on due to the MANIFEST line @@ -47,11 +47,13 @@ JIMAGE_PKGS := \ # $(eval $(call SetupJavaCompilation, BUILD_JRTFS, \ - SETUP := GENERATE_8_BYTECODE, \ + COMPILER := bootjdk, \ + TARGET_RELEASE := $(TARGET_RELEASE_JDK8), \ SRC := $(TOPDIR)/src/java.base/share/classes, \ EXCLUDE_FILES := module-info.java, \ INCLUDES := $(JIMAGE_PKGS), \ - BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes)) + BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \ +)) # Because of the explicit INCLUDES in the compilation setup above, the service provider # file will not be copied unless META-INF/services would also be added to the INCLUDES. @@ -62,7 +64,7 @@ $(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \ DEST := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \ FILES := META-INF/services/java.nio.file.spi.FileSystemProvider)) -$(eval $(call SetupJarArchive,BUILD_JRTFS_JAR, \ +$(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \ DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \ SRCS := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \ JAR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/jrt-fs.jar, \ diff --git a/make/Main.gmk b/make/Main.gmk index e7a4bc9f30e..1eb3b2b1dfd 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -127,7 +127,7 @@ GENSRC_TARGETS += $(sort $(GENSRC_MODULEINFO_TARGETS) \ define DeclareModuleInfoRecipe $1-gensrc-moduleinfo: +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \ - -f gensrc/GensrcModuleInfo.gmk MODULE=$1) + -f common/modules/GensrcModuleInfo.gmk MODULE=$1) $1-gensrc: $1-gensrc-moduleinfo endef diff --git a/make/MainSupport.gmk b/make/MainSupport.gmk index a31b84426e3..5fdcd77e2f8 100644 --- a/make/MainSupport.gmk +++ b/make/MainSupport.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -129,18 +129,17 @@ define DeclareRecipeForModuleMakefile $2-$$($1_TARGET_SUFFIX): ifeq ($$($1_USE_WRAPPER), true) +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \ - -f ModuleWrapper.gmk \ + -f ModuleWrapper.gmk -I $$(TOPDIR)/make/common/modules \ $$(addprefix -I, $$(PHASE_MAKEDIRS) \ - $$(addsuffix /$$($1_MAKE_SUBDIR), $$(PHASE_MAKEDIRS)) \ + $$(addsuffix /modules/$2, $$(PHASE_MAKEDIRS)) \ ) \ MODULE=$2 MAKEFILE_PREFIX=$$($1_FILE_PREFIX) $$($1_EXTRA_ARGS)) else - +($(CD) $$(dir $$(firstword $$(wildcard $$(addsuffix \ - /$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, $$(PHASE_MAKEDIRS))))) \ + +($(CD) $$(TOPDIR)/make \ && $(MAKE) $(MAKE_ARGS) \ - -f $$($1_FILE_PREFIX)-$2.gmk \ + -f modules/$2/$$($1_FILE_PREFIX).gmk -I $$(TOPDIR)/make/common/modules \ $$(addprefix -I, $$(PHASE_MAKEDIRS) \ - $$(addsuffix /$$($1_MAKE_SUBDIR), $$(PHASE_MAKEDIRS)) \ + $$(addsuffix /modules/$2, $$(PHASE_MAKEDIRS)) \ ) \ MODULE=$2 $$($1_EXTRA_ARGS) \ ) @@ -153,7 +152,7 @@ endef # Param 2: Module name define DeclareRecipesForPhaseAndModule $1_$2_MAKEFILES := $$(strip $$(wildcard \ - $$(addsuffix /$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, $$(PHASE_MAKEDIRS)))) + $$(addsuffix /modules/$2/$$($1_FILE_PREFIX).gmk, $$(PHASE_MAKEDIRS)))) # Only declare recipes if there are makefiles to call ifneq ($$($1_$2_MAKEFILES), ) diff --git a/make/ModuleTools.gmk b/make/ModuleTools.gmk index c48a1b6ec3d..020e12d6e4b 100644 --- a/make/ModuleTools.gmk +++ b/make/ModuleTools.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ TOOL_GENGRAPHS := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \ TOOL_MODULESUMMARY := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \ build.tools.jigsaw.ModuleSummary -TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL) \ +TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL_BUILDJDK) \ -cp $(TOOLS_CLASSES_DIR) \ --add-exports java.base/jdk.internal.module=ALL-UNNAMED \ build.tools.jigsaw.AddPackagesAttribute diff --git a/make/ModuleWrapper.gmk b/make/ModuleWrapper.gmk index 84813264e79..c9f1de23995 100644 --- a/make/ModuleWrapper.gmk +++ b/make/ModuleWrapper.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ include MakeBase.gmk TARGETS := # Include the file being wrapped. -include $(MAKEFILE_PREFIX)-$(MODULE).gmk +include modules/$(MODULE)/$(MAKEFILE_PREFIX).gmk # Setup copy rules from the modules directories to the jdk image directory. ifeq ($(call isTargetOs, windows), true) diff --git a/make/RunTestsPrebuiltSpec.gmk b/make/RunTestsPrebuiltSpec.gmk index dc533a01266..6fe80cffcec 100644 --- a/make/RunTestsPrebuiltSpec.gmk +++ b/make/RunTestsPrebuiltSpec.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -63,8 +63,9 @@ TEST_JOBS ?= 0 # Use hard-coded values for java flags (one size, fits all!) JAVA_FLAGS := -Duser.language=en -Duser.country=US -JAVA_FLAGS_BIG:= -Xms64M -Xmx1600M -XX:ThreadStackSize=1536 -JAVA_FLAGS_SMALL:= -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1 +JAVA_FLAGS_BIG := -Xms64M -Xmx1600M +JAVA_FLAGS_SMALL := -XX:+UseSerialGC -Xms32M -Xmx512M -XX:TieredStopAtLevel=1 +BUILDJDK_JAVA_FLAGS_SMALL := -Xms32M -Xmx512M -XX:TieredStopAtLevel=1 BUILD_JAVA_FLAGS := $(JAVA_FLAGS_BIG) ################################################################################ @@ -120,7 +121,7 @@ JARSIGNER_CMD := $(BOOT_JDK)/bin/jarsigner JAVA := $(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS) JAVA_SMALL := $(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS) -JAVA_JAVAC := $(FIXPATH) $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS) +JAVA_DETACH := $(FIXPATH) $(FIXPATH_DETACH_FLAG) $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS) JAVAC := $(FIXPATH) $(JAVAC_CMD) JAR := $(FIXPATH) $(JAR_CMD) JLINK := $(FIXPATH) $(JLINK_CMD) diff --git a/make/ToolsLangtools.gmk b/make/ToolsLangtools.gmk index 2f2df2556e3..86fb364a7cd 100644 --- a/make/ToolsLangtools.gmk +++ b/make/ToolsLangtools.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -29,18 +29,17 @@ default: all include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk ################################################################################ # Setup the compilation of the properties compilation tool. You can depend # upon $(BUILD_TOOLS_LANGTOOLS) to trigger a compilation of the tools. -$(eval $(call SetupJavaCompilation,BUILD_TOOLS_LANGTOOLS, \ - SETUP := BOOT_JAVAC, \ - DISABLE_SJAVAC := true, \ - ADD_JAVAC_FLAGS := -Xprefer:source, \ +$(eval $(call SetupJavaCompilation, BUILD_TOOLS_LANGTOOLS, \ + COMPILER := bootjdk, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := $(TOPDIR)/make/langtools/tools, \ INCLUDES := compileproperties propertiesparser, \ COPY := .properties, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes)) + BIN := $(BUILDTOOLS_OUTPUTDIR)/langtools_tools_classes, \ +)) all: $(BUILD_TOOLS_LANGTOOLS) diff --git a/make/autoconf/boot-jdk.m4 b/make/autoconf/boot-jdk.m4 index 874adab97b8..76be7905b5a 100644 --- a/make/autoconf/boot-jdk.m4 +++ b/make/autoconf/boot-jdk.m4 @@ -347,11 +347,10 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK], # oldest supported bootjdk. OLDEST_BOOT_JDK=`$ECHO $DEFAULT_ACCEPTABLE_BOOT_VERSIONS \ | $TR " " "\n" | $SORT -n | $HEAD -n1` - BOOT_JDK_SOURCETARGET="-source $OLDEST_BOOT_JDK -target $OLDEST_BOOT_JDK" + # -Xlint:-options is added to avoid "warning: [options] system modules path not set in conjunction with -source" + BOOT_JDK_SOURCETARGET="-source $OLDEST_BOOT_JDK -target $OLDEST_BOOT_JDK -Xlint:-options" AC_SUBST(BOOT_JDK_SOURCETARGET) - AC_SUBST(JAVAC_FLAGS) - # Check if the boot jdk is 32 or 64 bit if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then BOOT_JDK_BITS="64" @@ -433,12 +432,10 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], UTIL_ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) BOOTCYCLE_JVM_ARGS_BIG=-Xms64M - # Maximum amount of heap memory and stack size. + # Maximum amount of heap memory. JVM_HEAP_LIMIT_32="768" # Running a 64 bit JVM allows for and requires a bigger heap JVM_HEAP_LIMIT_64="1600" - STACK_SIZE_32=768 - STACK_SIZE_64=1536 JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2` if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL @@ -452,14 +449,11 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], fi if test "x$BOOT_JDK_BITS" = "x32"; then - STACK_SIZE=$STACK_SIZE_32 JVM_MAX_HEAP=$JVM_HEAP_LIMIT_32 else - STACK_SIZE=$STACK_SIZE_64 JVM_MAX_HEAP=$JVM_HEAP_LIMIT_64 fi UTIL_ADD_JVM_ARG_IF_OK([-Xmx${JVM_MAX_HEAP}M],boot_jdk_jvmargs_big,[$JAVA]) - UTIL_ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs_big,[$JAVA]) AC_MSG_RESULT([$boot_jdk_jvmargs_big]) @@ -468,21 +462,14 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_32 - BOOTCYCLE_STACK_SIZE=$STACK_SIZE_32 else BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_64 - BOOTCYCLE_STACK_SIZE=$STACK_SIZE_64 fi BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -Xmx${BOOTCYCLE_MAX_HEAP}M" - BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -XX:ThreadStackSize=$BOOTCYCLE_STACK_SIZE" AC_MSG_CHECKING([flags for bootcycle boot jdk java command for big workloads]) AC_MSG_RESULT([$BOOTCYCLE_JVM_ARGS_BIG]) AC_SUBST(BOOTCYCLE_JVM_ARGS_BIG) - # By default, the main javac compilations use big - JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG" - AC_SUBST(JAVA_FLAGS_JAVAC) - AC_MSG_CHECKING([flags for boot jdk java command for small workloads]) # Use serial gc for small short lived tools if possible @@ -496,6 +483,11 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], JAVA_FLAGS_SMALL=$boot_jdk_jvmargs_small AC_SUBST(JAVA_FLAGS_SMALL) + # Don't presuppose SerialGC is present in the buildjdk. Also, we cannot test + # the buildjdk, but on the other hand we know what it will support. + BUILDJDK_JAVA_FLAGS_SMALL="-Xms32M -Xmx512M -XX:TieredStopAtLevel=1" + AC_SUBST(BUILDJDK_JAVA_FLAGS_SMALL) + JAVA_TOOL_FLAGS_SMALL="" for f in $JAVA_FLAGS_SMALL; do JAVA_TOOL_FLAGS_SMALL="$JAVA_TOOL_FLAGS_SMALL -J$f" diff --git a/make/autoconf/bootcycle-spec.gmk.in b/make/autoconf/bootcycle-spec.gmk.in index 0a8496a3421..13f28af3ee2 100644 --- a/make/autoconf/bootcycle-spec.gmk.in +++ b/make/autoconf/bootcycle-spec.gmk.in @@ -35,10 +35,6 @@ ifeq ($(firstword $(JAVA)),$(FIXPATH)) else JAVA_EXEC_POS=1 endif -ifneq ($(word $(JAVA_EXEC_POS),$(SJAVAC_SERVER_JAVA)),$(word $(JAVA_EXEC_POS),$(JAVA))) - $(error Bootcycle builds are not possible if --with-sjavac-server-java is specified) -endif - # Override specific values to do a boot cycle build @@ -54,12 +50,6 @@ JAVA_CMD:=$(BOOT_JDK)/bin/java JAVAC_CMD:=$(BOOT_JDK)/bin/javac JAR_CMD:=$(BOOT_JDK)/bin/jar JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner -SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD) -# When building a 32bit target, make sure the sjavac server flags are compatible -# with a 32bit JVM. -ifeq ($(OPENJDK_TARGET_CPU_BITS), 32) - SJAVAC_SERVER_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@ -endif # The bootcycle JVM arguments may differ from the original boot jdk. JAVA_FLAGS_BIG := @BOOTCYCLE_JVM_ARGS_BIG@ # Any CDS settings generated for the bootjdk are invalid in the bootcycle build. diff --git a/make/autoconf/build-performance.m4 b/make/autoconf/build-performance.m4 index fde81a42603..94460311bc8 100644 --- a/make/autoconf/build-performance.m4 +++ b/make/autoconf/build-performance.m4 @@ -393,72 +393,11 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS], ]) -AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC], +AC_DEFUN_ONCE([BPERF_SETUP_JAVAC_SERVER], [ - AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java], - [use this java binary for running the sjavac background server @<:@Boot JDK java@:>@])]) - - if test "x$with_sjavac_server_java" != x; then - SJAVAC_SERVER_JAVA="$with_sjavac_server_java" - FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""` - if test "x$FOUND_VERSION" = x; then - AC_MSG_ERROR([Could not execute server java: $SJAVAC_SERVER_JAVA]) - fi - else - SJAVAC_SERVER_JAVA="$JAVA" - fi - AC_SUBST(SJAVAC_SERVER_JAVA) - - if test "$MEMORY_SIZE" -gt "3000"; then - if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then - JVM_64BIT=true - fi - fi - - MX_VALUE=`expr $MEMORY_SIZE / 2` - if test "$JVM_64BIT" = true; then - # Set ms lower than mx since more than one instance of the server might - # get launched at the same time before they figure out which instance won. - MS_VALUE=512 - if test "$MX_VALUE" -gt "2048"; then - MX_VALUE=2048 - fi - else - MS_VALUE=256 - if test "$MX_VALUE" -gt "1500"; then - MX_VALUE=1500 - fi - fi - if test "$MX_VALUE" -lt "512"; then - MX_VALUE=512 - fi - - JAVAC_SERVER_AVAILABLE=true - SJAVAC_MEMORY_OPT="-Xms${MS_VALUE}M -Xmx${MX_VALUE}M" - UTIL_ADD_JVM_ARG_IF_OK([$SJAVAC_MEMORY_OPT],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA]) - if test "x$JVM_ARG_OK" = "xfalse"; then - AC_MSG_WARN([Could not set '$SJAVAC_MEMORY_OPT' on bootjdk, disabling sjavac and javac server]) - JAVAC_SERVER_AVAILABLE=false - fi - AC_SUBST(SJAVAC_SERVER_JAVA_FLAGS) - - UTIL_ARG_ENABLE(NAME: sjavac, DEFAULT: false, AVAILABLE: $JAVAC_SERVER_AVAILABLE, - DESC: [use sjavac to do fast incremental compiles], - CHECKING_MSG: [whether to use sjavac], - IF_ENABLED: [ ENABLE_SJAVAC="yes" ], - IF_DISABLED: [ ENABLE_SJAVAC="no" ]) - AC_SUBST(ENABLE_SJAVAC) - - UTIL_ARG_ENABLE(NAME: javac-server, DEFAULT: true, AVAILABLE: $JAVAC_SERVER_AVAILABLE, + UTIL_ARG_ENABLE(NAME: javac-server, DEFAULT: true, + RESULT: ENABLE_JAVAC_SERVER, DESC: [enable javac server], - CHECKING_MSG: [whether to use javac server], - IF_ENABLED: [ ENABLE_JAVAC_SERVER="yes" ], - IF_DISABLED: [ ENABLE_JAVAC_SERVER="no" ]) + CHECKING_MSG: [whether to use javac server]) AC_SUBST(ENABLE_JAVAC_SERVER) - - if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then - # When using a server javac, the small client instances do not need much - # resources. - JAVA_FLAGS_JAVAC="$JAVA_FLAGS_SMALL" - fi ]) diff --git a/make/autoconf/configure.ac b/make/autoconf/configure.ac index dce5f26ac2c..2f08dca16a6 100644 --- a/make/autoconf/configure.ac +++ b/make/autoconf/configure.ac @@ -261,13 +261,11 @@ BPERF_SETUP_BUILD_CORES BPERF_SETUP_BUILD_MEMORY BPERF_SETUP_BUILD_JOBS BPERF_SETUP_TEST_JOBS +BPERF_SETUP_JAVAC_SERVER # Setup arguments for the boot jdk (after cores and memory have been setup) BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS -# Setup smart javac (after cores and memory have been setup) -BPERF_SETUP_SMART_JAVAC - # Setup use of icecc if requested BPERF_SETUP_ICECC diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index 982fd18aa29..e45433ac6c8 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -364,9 +364,6 @@ BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@ # Information about the build system NUM_CORES:=@NUM_CORES@ MEMORY_SIZE:=@MEMORY_SIZE@ -# Enable sjavac support = use a javac server, -# multi core javac compilation and dependency tracking. -ENABLE_SJAVAC:=@ENABLE_SJAVAC@ ENABLE_JAVAC_SERVER:=@ENABLE_JAVAC_SERVER@ # Store sjavac server synchronization files here, and # the sjavac server log files. @@ -630,9 +627,8 @@ STRIPFLAGS:=@STRIPFLAGS@ JAVA_FLAGS:=@JAVA_FLAGS@ JAVA_FLAGS_BIG:=@JAVA_FLAGS_BIG@ JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@ -JAVA_FLAGS_JAVAC:=@JAVA_FLAGS_JAVAC@ +BUILDJDK_JAVA_FLAGS_SMALL:=@BUILDJDK_JAVA_FLAGS_SMALL@ JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@ -SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@ # The *_CMD variables are defined separately to be easily overridden in bootcycle-spec.gmk # for bootcycle-images build. Make sure to keep them in sync. Do not use the *_CMD @@ -645,12 +641,11 @@ JLINK_CMD := @JLINK@ JMOD_CMD := @JMOD@ JARSIGNER_CMD:=@JARSIGNER@ JJS_CMD:=@JJS@ -SJAVAC_SERVER_JAVA_CMD:=@SJAVAC_SERVER_JAVA@ # These variables are meant to be used. They are defined with = instead of := to make # it possible to override only the *_CMD variables. JAVA=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS) JAVA_SMALL=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_SMALL) $(JAVA_FLAGS) -JAVA_JAVAC=@FIXPATH@ $(JAVA_CMD) $(JAVA_FLAGS_JAVAC) $(JAVA_FLAGS) +JAVA_DETACH =@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS) JAVAC=@FIXPATH@ $(JAVAC_CMD) JAVADOC=@FIXPATH@ $(JAVADOC_CMD) JAR=@FIXPATH@ $(JAR_CMD) @@ -658,15 +653,6 @@ JLINK = @FIXPATH@ $(JLINK_CMD) $(JAVA_TOOL_FLAGS_SMALL) JMOD = @FIXPATH@ $(JMOD_CMD) $(JAVA_TOOL_FLAGS_SMALL) JARSIGNER=@FIXPATH@ $(JARSIGNER_CMD) JJS=@FIXPATH@ $(JJS_CMD) $(JAVA_TOOL_FLAGS_SMALL) -# A specific java binary with specific options can be used to run -# the long running background sjavac servers and other long running tasks. -SJAVAC_SERVER_JAVA=@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(SJAVAC_SERVER_JAVA_CMD) \ - $(SJAVAC_SERVER_JAVA_FLAGS) - -# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid -# overriding that value by using ?=. -JAVAC_FLAGS?=@JAVAC_FLAGS@ - BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@ BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS) diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index 34ece1d46f0..22a5e5b07cb 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -23,10 +23,6 @@ # questions. # -# When you read this source. Remember that $(sort ...) has the side effect -# of removing duplicates. It is actually this side effect that is -# desired whenever sort is used below! - ifndef _JAVA_COMPILATION_GMK _JAVA_COMPILATION_GMK := 1 @@ -39,30 +35,22 @@ endif include JarArchive.gmk include ZipArchive.gmk -# Setup make rules for defining a Java compiler, which is needed to compile -# Java code. This rule generates no output. -# -# Parameter 1 is the name of the compiler definition. This name needs to be -# passed to SetupJavaCompilation. This name is used as variable prefix. -# -# Remaining parameters are named arguments. These include: -# JVM:=The jvm used to run the javac command -# JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out -# FLAGS:=Flags to be supplied to javac -# SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here -# SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above. -# DISABLE_SJAVAC:=Set to true if this setup does not support sjavac -SetupJavaCompiler = $(NamedParamsMacroTemplate) -define SetupJavaCompilerBody - # The port file contains the tcp/ip on which the server listens - # and the cookie necessary to talk to the server. - $1_SJAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port - # You can use a different JVM to run the background javac server. - ifeq ($$($1_SERVER_JVM),) - # It defaults to the same JVM that is used to start the javac command. - $1_SERVER_JVM:=$$($1_JVM) - endif -endef +### +### Definitions for common release targets +### + +# Create classes that can run on the bootjdk +TARGET_RELEASE_BOOTJDK := $(BOOT_JDK_SOURCETARGET) + +# Create classes that can be used in (or be a part of) the new jdk we're building +TARGET_RELEASE_NEWJDK := -source $(JDK_SOURCE_TARGET_VERSION) -target $(JDK_SOURCE_TARGET_VERSION) + +# Create classes that can be used in JDK 8, for legacy support +TARGET_RELEASE_JDK8 := --release 8 + +# Create classes for the new jdk, relying only on the modules of the new jdk +TARGET_RELEASE_NEWJDK_UPGRADED := $(TARGET_RELEASE_NEWJDK) \ + --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none define add_file_to_copy # param 1 = BUILD_MYPACKAGE @@ -76,7 +64,7 @@ define add_file_to_copy $1_COPY_$$($2_TARGET) := 1 # Now we can setup the dependency that will trigger the copying. $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2 - $$(call LogInfo, Copying $$(patsubst $(OUTPUTDIR)/%,%, $$@)) + $$(call LogInfo, Copying $$(patsubst $$(OUTPUTDIR)/%,%, $$@)) $$(install-file) $(CHMOD) -f ug+w $$@ @@ -86,10 +74,7 @@ define add_file_to_copy endef # This macro is used only for properties files that are to be -# copied over to the classes directory in cleaned form: -# Previously this was inconsistently done in different repositories. -# This is the new clean standard. Though it is to be superseded by -# a standard annotation processor from with sjavac. +# copied over to the classes directory in cleaned form. # # An empty echo ensures that the input to sed always ends with a newline. # Certain implementations (e.g. Solaris) will skip the last line without @@ -120,12 +105,12 @@ define add_file_to_clean ifneq ($$($1_CLEAN_$$($2_TARGET)), 1) $1_CLEAN_$$($2_TARGET) := 1 $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2 - $$(call LogInfo, Cleaning $$(patsubst $(OUTPUTDIR)/%,%, $$@)) + $$(call LogInfo, Cleaning $$(patsubst $$(OUTPUTDIR)/%,%, $$@)) $$(call MakeTargetDir) ( $(CAT) $$< && $(ECHO) "" ) \ | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \ -e 's/\([^\\]\)!/\1\\!/g' -e 's/^[ ]*#.*/#/g' \ - | $(SED) -f "$(TOPDIR)/make/common/support/unicode2x.sed" \ + | $(SED) -f "$$(TOPDIR)/make/common/support/unicode2x.sed" \ | $(SED) -e '/^#/d' -e '/^$$$$/d' \ -e :a -e '/\\$$$$/N; s/\\\n//; ta' \ -e 's/^[ ]*//;s/[ ]*$$$$//' \ @@ -151,9 +136,12 @@ endef # The target for public API digest is returned in $1_API_TARGET. # # Remaining parameters are named arguments. These include: -# SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC -# JVM:=path to ..bin/java -# ADD_JAVAC_FLAGS:=javac flags to append to the default ones. +# SMALL_JAVA:=set to false to run javac as a "big" java app +# COMPILER:=bootjdk or interim, the latter is default +# TARGET_RELEASE:=javac flags to set the targeted jdk release (-source/-target or --release) +# Defaults to $(TARGET_RELEASE_NEWJDK). +# JAVAC_FLAGS:=javac flags to append to the default ones. +# JAVA_FLAGS:=flags to be appended to the java launching the compiler # DISABLED_WARNINGS:=list of Xlint warnings that should be disabled # SRC:=one or more directories to search for sources. The order of the source roots # is significant. The first found file of a certain name has priority. @@ -174,14 +162,12 @@ endef # specify files that need to be generated by other rules first. # HEADERS:=path to directory where all generated c-headers are written. # DEPENDS:=Extra dependecy -# DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit. # KEEP_DUPS:=Do not remove duplicate file names from different source roots. # FAIL_NO_SRC:=Set to false to not fail the build if no source files are found, # default is true. -# DEBUG_SYMBOLS:=Set to false to disable generation of debug symbols. # CREATE_API_DIGEST:=Set to true to use a javac plugin to generate a public API # hash which can be used for down stream dependencies to only rebuild -# when the API changes. Implicitly used in sjavac. +# when the API changes. # KEEP_ALL_TRANSLATIONS:=Set to true to skip translation filtering SetupJavaCompilation = $(NamedParamsMacroTemplate) define SetupJavaCompilationBody @@ -191,14 +177,76 @@ define SetupJavaCompilationBody $$(error Must specify BIN (in $1)) endif - # Extract the info from the java compiler setup. - $1_JVM := $$($$($1_SETUP)_JVM) - $1_JAVAC := $$($$($1_SETUP)_JAVAC) - $1_FLAGS := - ifneq ($$($1_DEBUG_SYMBOLS), false) - $1_FLAGS := -g + ifeq ($$($1_SMALL_JAVA), ) + # If unspecified, default to true + $1_SMALL_JAVA := true + endif + + ifeq ($$($1_COMPILER), ) + # If unspecified, default to interim compiler + $1_COMPILER := interim + endif + + ifeq ($$($1_COMPILER), bootjdk) + # Javac server is not available when using the bootjdk compiler. + $1_JAVAC_CMD := $$(JAVAC) + + ifeq ($$($1_SMALL_JAVA), true) + $1_FLAGS += $$(addprefix -J, $$(JAVA_FLAGS_SMALL)) + endif + ifeq ($$($1_JAVA_FLAGS), true) + $1_FLAGS += $$(addprefix -J, $$($1_JAVA_FLAGS)) + endif + + ifeq ($$($1_TARGET_RELEASE), ) + # If unspecified, default to the new jdk we're building + $1_TARGET_RELEASE := $$(TARGET_RELEASE_BOOTJDK) + endif + else ifeq ($$($1_COMPILER), interim) + # Use java server if it is enabled, and the user does not want a specialized + # class path. + ifeq ($$(ENABLE_JAVAC_SERVER)+$$($1_CLASSPATH), true+) + $1_JAVAC := $$(INTERIM_LANGTOOLS_ARGS) -m jdk.compiler.interim/com.sun.tools.sjavac.Main + + # How to launch the server. This must use JAVA_DETACH, which is the "big" java + # with an ability to detach from fixpath (on Windows) + # This will be executed by the client, if needed. + $1_JAVAC_SERVER_CMD := $$(JAVA_DETACH) $$($1_JAVA_FLAGS) $$($1_JAVAC) + $1_ESCAPED_CMD := $$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_JAVAC_SERVER_CMD)))) + + # The port file contains the tcp/ip on which the server listens + # and the cookie necessary to talk to the server. + $1_JAVA_SERVER_FLAGS := --server:portfile=$$(SJAVAC_SERVER_DIR)/server.port,sjavac=$$($1_ESCAPED_CMD) + + # Always use small to launch client + $1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC) $$($1_JAVA_SERVER_FLAGS) + else + # No javac server + $1_JAVAC := $$(INTERIM_LANGTOOLS_ARGS) -m jdk.compiler.interim/com.sun.tools.javac.Main + + ifeq ($$($1_SMALL_JAVA), true) + $1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC) + else + $1_JAVAC_CMD := $$(JAVA) $$($1_JAVA_FLAGS) $$($1_JAVAC) + endif + endif + + ifeq ($$($1_TARGET_RELEASE), ) + # If unspecified, default to the new jdk we're building + $1_TARGET_RELEASE := $$(TARGET_RELEASE_NEWJDK) + endif + else + $$(error Invalid value for COMPILER in SetupJavaCompilation for $1: '$$($1_COMPILER)') endif - $1_FLAGS += $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS) + + # Allow overriding on the command line + JAVA_WARNINGS_ARE_ERRORS ?= -Werror + + # Tell javac to do exactly as told and no more + PARANOIA_FLAGS := -implicit:none -Xprefer:source -XDignore.symbol.file=true -encoding ascii + + $1_FLAGS += -g -Xlint:all --doclint-format html5 $$($1_TARGET_RELEASE) $$(PARANOIA_FLAGS) $$(JAVA_WARNINGS_ARE_ERRORS) + $1_FLAGS += $$($1_JAVAC_FLAGS) ifneq ($$($1_DISABLED_WARNINGS), ) $1_FLAGS += -Xlint:$$(call CommaList, $$(addprefix -, $$($1_DISABLED_WARNINGS))) @@ -208,13 +256,6 @@ define SetupJavaCompilationBody $1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH)) endif - ifeq ($$($1_JAVAC),) - $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP)) - endif - $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE) - $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM) - $1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC) - ifneq ($$($1_MODULE), ) $1_MODULE_SUBDIR := /$$($1_MODULE) endif @@ -264,13 +305,10 @@ define SetupJavaCompilationBody # Remove duplicate source files by keeping the first found of each duplicate. # This allows for automatic overrides with custom or platform specific versions # source files. - # - # For the smart javac wrapper case, add each removed file to an extra exclude - # file list to prevent sjavac from finding duplicate sources. $1_SRCS := $$(strip $$(foreach s, $$($1_SRCS), \ $$(eval relative_src := $$(call remove-prefixes, $$($1_SRC), $$(s))) \ $$(if $$($1_$$(relative_src)), \ - $$(eval $1_SJAVAC_EXCLUDE_FILES += $$(s)), \ + , \ $$(eval $1_$$(relative_src) := 1) $$(s)))) endif @@ -343,92 +381,15 @@ define SetupJavaCompilationBody # and remove .java at the end. $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g' - # Create SJAVAC variable from JAVAC variable. Expects $1_JAVAC to be - # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main" - # and javac is simply replaced with sjavac. - $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC)) - - # Set the $1_REMOTE to spawn a background javac server. - $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst \ - $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) - $1_COMPILE_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch $1_API_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi - ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) - # Using sjavac to compile. - - # Create the sjavac wrapper command line. Sjavac doesn't handle patterns that - # match the absolute path, only the part inside each src dir. Instead -i and - # -x flags apply only to the next -src arg on the command line. - $1_EXCLUDE_FILES_ABS := $$(filter /%, $$($1_EXCLUDE_FILES)) $$($1_SJAVAC_EXCLUDE_FILES) - $1_EXCLUDE_FILES_REL := $$(filter-out /%, $$($1_EXCLUDE_FILES)) - $1_SJAVAC_ARGS_STRING := $$(foreach s, $$(patsubst %/, %, $$($1_SRC)), \ - $$(addprefix -x ,$$(addsuffix /**,$$($1_EXCLUDES))) \ - $$(addprefix -i ,$$(addsuffix /**,$$($1_INCLUDES))) \ - $$(addprefix -x **,$$(strip $$($1_EXCLUDE_FILES_REL))) \ - $$(addprefix -i **,$$(strip $$($1_INCLUDE_FILES))) \ - $$(addprefix -x , $$(strip $$(patsubst $$(s)/%, %, $$(filter $$(s)/%, $$($1_EXCLUDE_FILES_ABS))))) \ - -src $$(s)) - - ifneq ($$(word 20, $$($1_SJAVAC_ARGS_STRING)), ) - $1_SJAVAC_ARGS_FILE := $$($1_BIN)/_the.$1_args - $1_SJAVAC_ARGS := @$$($1_SJAVAC_ARGS_FILE) - else - $1_SJAVAC_ARGS := $$($1_SJAVAC_ARGS_STRING) - endif - - - ifneq (,$$($1_HEADERS)) - $1_HEADERS_ARG := -h $$($1_HEADERS) - endif - - $1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS_STRING) $$($1_FLAGS) \ - $$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \ - $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) - $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ - $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps) - - $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) - $$(call MakeDir, $$(@D) $$(dir $$($1_SJAVAC_PORTFILE))) - $$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp)) - ifneq ($$($1_SJAVAC_ARGS_FILE), ) - $$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE))) - endif - $$(call LogWarn, Compiling $1) - $$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \ - $$($1_JVM) $$($1_SJAVAC) \ - $$($1_REMOTE) \ - -j 1 \ - --permit-unidentified-artifacts \ - --permit-sources-without-package \ - --compare-found-sources $$@.tmp \ - --log=$(LOG_LEVEL) \ - --state-dir=$$($1_BIN)$$($1_MODULE_SUBDIR) \ - $$($1_SJAVAC_ARGS) \ - $$($1_FLAGS) \ - $$($1_HEADERS_ARG) \ - -d $$($1_BIN)) && \ - $(MV) $$@.tmp $$@ - # Create a pubapi file that only changes when the pubapi changes. Dependent - # compilations can use this file to only get recompiled when pubapi has changed. - # Grep returns 1 if no matching lines are found. Do not fail for this. - $(GREP) -e "^I" $$($1_BIN)$$($1_MODULE_SUBDIR)/javac_state \ - > $$($1_API_TARGET).tmp || test "$$$$?" = "1" - if [ ! -f $$($1_API_TARGET) ] \ - || [ "`$(DIFF) $$($1_API_TARGET) $$($1_API_TARGET).tmp`" != "" ]; then \ - $(MV) $$($1_API_TARGET).tmp $$($1_API_TARGET); \ - fi - - else - # Using plain javac to batch compile everything. - - # When building in batch, put headers in a temp dir to filter out those that actually - # changed before copying them to the real header dir. - ifneq (,$$($1_HEADERS)) - $1_HEADERS_ARG := -h $$($1_HEADERS).$1.tmp + # Put headers in a temp dir to filter out those that actually + # changed before copying them to the real header dir. + ifneq (,$$($1_HEADERS)) + $1_HEADERS_ARG := -h $$($1_HEADERS).$1.tmp - $$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET) + $$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET) $$(call MakeTargetDir) if [ -d "$$($1_HEADERS).$1.tmp" ]; then \ for f in `$(CD) $$($1_HEADERS).$1.tmp && $(FIND) . -type f`; do \ @@ -442,43 +403,35 @@ define SetupJavaCompilationBody $(RM) -r $$($1_HEADERS).$1.tmp $(TOUCH) $$@ - $1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers - endif - - $1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) \ - $$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \ - $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) - $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ - $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps) + $1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers + endif - ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes) - $1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE) - else - $1_JAVAC_CMD := $$($1_JAVAC) - endif + $1_VARDEPS := $$($1_JAVAC_CMD) $$($1_FLAGS) $$($1_BIN) \ + $$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \ + $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) + $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ + $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps) - ifeq ($$($1_CREATE_API_DIGEST), true) - $1_API_DIGEST_FLAGS := \ - -classpath $(BUILDTOOLS_OUTPUTDIR)/depend \ - -Xplugin:"depend $$($1_API_TARGET)" \ - # + ifeq ($$($1_CREATE_API_DIGEST), true) + $1_API_DIGEST_FLAGS := \ + -classpath $$(BUILDTOOLS_OUTPUTDIR)/depend \ + -Xplugin:"depend $$($1_API_TARGET)" \ + # - $1_EXTRA_DEPS := $(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch - endif + $1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch + endif - # When not using sjavac, pass along all sources to javac using an @file. - $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) \ - $$($1_EXTRA_DEPS) + # Pass along all sources to javac using an @file. + $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) \ + $$($1_EXTRA_DEPS) $$(call MakeDir, $$(@D)) $$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp)) $$(call LogWarn, Compiling $$(words $$($1_SRCS)) files for $1) $$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \ - $$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \ - -implicit:none \ + $$($1_JAVAC_CMD) $$($1_FLAGS) \ $$($1_API_DIGEST_FLAGS) \ -d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \ $(MV) $$@.tmp $$@ - endif # Add all targets to main variable $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_COMPILE_TARGET) \ @@ -506,7 +459,6 @@ define SetupJavaCompilationBody EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR), \ JARINDEX:=$$($1_JARINDEX), \ HEADERS:=$$($1_HEADERS), \ - SETUP:=$$($1_SETUP), \ )) # Add jar to target list diff --git a/make/common/SetupJavaCompilers.gmk b/make/common/SetupJavaCompilers.gmk deleted file mode 100644 index b2ff40df8dc..00000000000 --- a/make/common/SetupJavaCompilers.gmk +++ /dev/null @@ -1,104 +0,0 @@ -# -# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -ifndef _SETUP_GMK -_SETUP_GMK := 1 - -# Include custom extension hook -$(eval $(call IncludeCustomExtension, common/SetupJavaCompilers.gmk)) - -include JavaCompilation.gmk - -JDK_SOURCE_TARGET_FLAGS := -source $(JDK_SOURCE_TARGET_VERSION) \ - -target $(JDK_SOURCE_TARGET_VERSION) - -# If warnings needs to be non-fatal for testing purposes use a command like: -# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000" -JAVAC_WARNINGS ?= -Xlint:all -Werror - -# The BOOT_JAVAC setup uses the boot jdk compiler to compile the tools -# and the interim javac, to be run by the boot jdk. -$(eval $(call SetupJavaCompiler,BOOT_JAVAC, \ - JAVAC := $(JAVAC), \ - FLAGS := \ - $(JAVA_TOOL_FLAGS_SMALL) \ - $(BOOT_JDK_SOURCETARGET) \ - -XDignore.symbol.file=true -g \ - $(JAVAC_WARNINGS) -Xlint:-options, \ - DISABLE_SJAVAC := true, \ -)) - -# Any java code executed during a JDK build to build other parts of the JDK must be -# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this -# purpose must be built with -target PREVIOUS for bootstrapping purposes, which -# requires restricting to language level and api of previous JDK. -# -# The generate old bytecode javac setup uses the new compiler to compile for the -# boot jdk to generate tools that need to be run with the boot jdk. -# Thus we force the target bytecode to the previous JDK version. -# Add -Xlint:-options to avoid the warning about not setting -bootclasspath. Since -# it's running on the boot jdk, the default bootclasspath is correct. -$(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \ - JVM := $(JAVA_SMALL), \ - JAVAC := $(NEW_JAVAC), \ - FLAGS := $(BOOT_JDK_SOURCETARGET) -XDignore.symbol.file=true -XDstringConcat=inline \ - $(JAVAC_WARNINGS) -Xlint:-options, \ - SERVER_DIR := $(SJAVAC_SERVER_DIR), \ - SERVER_JVM := $(SJAVAC_SERVER_JAVA))) - -# The generate new bytecode javac setup uses the new compiler to compile for the -# new jdk. This new bytecode might only be possible to run using the new jvm. -$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \ - JVM := $(JAVA_JAVAC), \ - JAVAC := $(NEW_JAVAC), \ - FLAGS := $(JDK_SOURCE_TARGET_FLAGS) --doclint-format html5 \ - -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS), \ - SERVER_DIR := $(SJAVAC_SERVER_DIR), \ - SERVER_JVM := $(SJAVAC_SERVER_JAVA))) - -# After the jdk is built, we want to build demos using only the recently -# generated jdk classes and nothing else, no jdk source, etc etc. -# I.e. the rt.jar, but since rt.jar has not yet been generated -# (it will be in "make images") therefore we use classes instead. -$(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE, \ - JVM := $(JAVA_SMALL), \ - JAVAC := $(NEW_JAVAC), \ - FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \ - $(JAVAC_WARNINGS), \ - SERVER_DIR := $(SJAVAC_SERVER_DIR), \ - SERVER_JVM := $(SJAVAC_SERVER_JAVA))) - -# Use boot javac to generate JDK 8 compatible class files explicitly -$(eval $(call SetupJavaCompiler,GENERATE_8_BYTECODE, \ - JAVAC := $(JAVAC), \ - FLAGS := \ - $(JAVA_TOOL_FLAGS_SMALL) \ - --release 8 \ - -XDignore.symbol.file=true -g \ - $(JAVAC_WARNINGS), \ - DISABLE_SJAVAC := true, \ -)) - -endif # _SETUP_GMK diff --git a/make/copy/CopyCommon.gmk b/make/common/modules/CopyCommon.gmk similarity index 100% rename from make/copy/CopyCommon.gmk rename to make/common/modules/CopyCommon.gmk diff --git a/make/gendata/GendataCommon.gmk b/make/common/modules/GendataCommon.gmk similarity index 91% rename from make/gendata/GendataCommon.gmk rename to make/common/modules/GendataCommon.gmk index 42c82eb48d7..0d5d39ea973 100644 --- a/make/gendata/GendataCommon.gmk +++ b/make/common/modules/GendataCommon.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,5 @@ # include JavaCompilation.gmk -include SetupJavaCompilers.gmk -# We need the tools. include ToolsJdk.gmk diff --git a/make/gensrc/GensrcCommonJdk.gmk b/make/common/modules/GensrcCommonJdk.gmk similarity index 91% rename from make/gensrc/GensrcCommonJdk.gmk rename to make/common/modules/GensrcCommonJdk.gmk index af3a1e71419..b44b0fe65a7 100644 --- a/make/gensrc/GensrcCommonJdk.gmk +++ b/make/common/modules/GensrcCommonJdk.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,4 @@ include Execute.gmk include JavaCompilation.gmk include NativeCompilation.gmk include TextFileProcessing.gmk -include SetupJavaCompilers.gmk -# We need the tools. include ToolsJdk.gmk diff --git a/make/gensrc/GensrcCommonLangtools.gmk b/make/common/modules/GensrcCommonLangtools.gmk similarity index 100% rename from make/gensrc/GensrcCommonLangtools.gmk rename to make/common/modules/GensrcCommonLangtools.gmk diff --git a/make/gensrc/GensrcModuleInfo.gmk b/make/common/modules/GensrcModuleInfo.gmk similarity index 100% rename from make/gensrc/GensrcModuleInfo.gmk rename to make/common/modules/GensrcModuleInfo.gmk diff --git a/make/gensrc/GensrcProperties.gmk b/make/common/modules/GensrcProperties.gmk similarity index 100% rename from make/gensrc/GensrcProperties.gmk rename to make/common/modules/GensrcProperties.gmk diff --git a/make/launcher/LauncherCommon.gmk b/make/common/modules/LauncherCommon.gmk similarity index 99% rename from make/launcher/LauncherCommon.gmk rename to make/common/modules/LauncherCommon.gmk index 6f7d3fb361a..788f9f1783b 100644 --- a/make/launcher/LauncherCommon.gmk +++ b/make/common/modules/LauncherCommon.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/make/lib/LibCommon.gmk b/make/common/modules/LibCommon.gmk similarity index 100% rename from make/lib/LibCommon.gmk rename to make/common/modules/LibCommon.gmk diff --git a/make/conf/jib-profiles.js b/make/conf/jib-profiles.js index 337d049bc59..67e109bfdb0 100644 --- a/make/conf/jib-profiles.js +++ b/make/conf/jib-profiles.js @@ -464,9 +464,12 @@ var getJibProfilesProfiles = function (input, common, data) { target_os: "linux", target_cpu: "aarch64", build_cpu: "x64", - dependencies: ["devkit", "build_devkit", "cups"], + dependencies: ["devkit", "build_devkit", "pandoc"], configure_args: [ "--openjdk-target=aarch64-linux-gnu", + "--disable-jvm-feature-jvmci", + "--disable-jvm-feature-graal", + "--disable-jvm-feature-aot", ], }, @@ -474,7 +477,7 @@ var getJibProfilesProfiles = function (input, common, data) { target_os: "linux", target_cpu: "arm", build_cpu: "x64", - dependencies: ["devkit", "build_devkit", "cups"], + dependencies: ["devkit", "build_devkit"], configure_args: [ "--openjdk-target=arm-linux-gnueabihf", "--with-freetype=bundled", "--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors" @@ -485,7 +488,7 @@ var getJibProfilesProfiles = function (input, common, data) { target_os: "linux", target_cpu: "ppc64le", build_cpu: "x64", - dependencies: ["devkit", "build_devkit", "cups"], + dependencies: ["devkit", "build_devkit"], configure_args: [ "--openjdk-target=ppc64le-linux-gnu", "--with-freetype=bundled", "--disable-warnings-as-errors" @@ -496,7 +499,7 @@ var getJibProfilesProfiles = function (input, common, data) { target_os: "linux", target_cpu: "s390x", build_cpu: "x64", - dependencies: ["devkit", "build_devkit", "cups"], + dependencies: ["devkit", "build_devkit"], configure_args: [ "--openjdk-target=s390x-linux-gnu", "--with-freetype=bundled", "--disable-warnings-as-errors" @@ -984,7 +987,7 @@ var getJibProfilesDependencies = function (input, common) { solaris_x64: "SS12u4-Solaris11u1+1.0", solaris_sparcv9: "SS12u6-Solaris11u3+1.0", windows_x64: "VS2017-15.9.16+1.0", - linux_aarch64: "gcc8.3.0-OL7.6+1.0", + linux_aarch64: "gcc9.2.0-OL7.6+1.0", linux_arm: "gcc8.2.0-Fedora27+1.0", linux_ppc64le: "gcc8.2.0-Fedora27+1.0", linux_s390x: "gcc8.2.0-Fedora27+1.0" @@ -1019,7 +1022,7 @@ var getJibProfilesDependencies = function (input, common) { organization: common.organization, ext: "tar.gz", module: "jdk-linux_aarch64", - revision: "13+1.0", + revision: "14+1.0", configure_args: "--with-boot-jdk=" + common.boot_jdk_home, environment_path: common.boot_jdk_home + "/bin" } @@ -1148,7 +1151,7 @@ var getJibProfilesDependencies = function (input, common) { pandoc: { organization: common.organization, ext: "tar.gz", - revision: "2.3.1+1.0", + revision: (input.build_cpu == 'aarch64' ? "2.5+1.0" : "2.3.1+1.0"), module: "pandoc-" + input.build_platform, configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc", environment_path: input.get("pandoc", "install_path") + "/pandoc" diff --git a/make/data/cacerts/keynectisrootca b/make/data/cacerts/keynectisrootca deleted file mode 100644 index 44483b2a42f..00000000000 --- a/make/data/cacerts/keynectisrootca +++ /dev/null @@ -1,30 +0,0 @@ -Owner: CN=KEYNECTIS ROOT CA, OU=ROOT, O=KEYNECTIS, C=FR -Issuer: CN=KEYNECTIS ROOT CA, OU=ROOT, O=KEYNECTIS, C=FR -Serial number: 1121bc276c5547af584eefd4ced629b2a285 -Valid from: Tue May 26 00:00:00 GMT 2009 until: Tue May 26 00:00:00 GMT 2020 -Signature algorithm name: SHA256withRSA -Subject Public Key Algorithm: 2048-bit RSA key -Version: 3 ------BEGIN CERTIFICATE----- -MIID5TCCAs2gAwIBAgISESG8J2xVR69YTu/UztYpsqKFMA0GCSqGSIb3DQEBCwUA -MEwxCzAJBgNVBAYTAkZSMRIwEAYDVQQKEwlLRVlORUNUSVMxDTALBgNVBAsTBFJP -T1QxGjAYBgNVBAMTEUtFWU5FQ1RJUyBST09UIENBMB4XDTA5MDUyNjAwMDAwMFoX -DTIwMDUyNjAwMDAwMFowTDELMAkGA1UEBhMCRlIxEjAQBgNVBAoTCUtFWU5FQ1RJ -UzENMAsGA1UECxMEUk9PVDEaMBgGA1UEAxMRS0VZTkVDVElTIFJPT1QgQ0EwggEi -MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDG/bMXhaGtJhuVaTUhPaSI+t7b -YDZAF2nCFGP7uNnCdBU3LpzQIM1pjYQyooVMFLSb8iWzVCqDPy2+D/M7ZNH/oFDv -d087TuE/C2SFmrpYftLDYtNkJaLUspc8d11jKjOS/M2CDZtUlYf1teuMzVvRyjAv -yYhGtc0NEbQYj+7RoT5dFegoz9/DkJtszNEMRXezOuuKkB3pr2RqiXupPUN0+uRn -IqH73E3E9WLJyiW0yYBgM6nde6ACv5YlCl7JXyl7tBeBi22BGdDZg1wFj0FpGmlD -gJ+or+DpjJGLJyuiJmDND/KkowKDjhiBwheKQxX5bfMdEKRanERhIyF62PvRAgMB -AAGjgcAwgb0wEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8EBAMCAQYwVwYD -VR0fBFAwTjBMoEqgSIZGaHR0cDovL3RydXN0Y2VudGVyLWNybC5jZXJ0aWZpY2F0 -Mi5jb20vS2V5bmVjdGlzL0tFWU5FQ1RJU19ST09UX0NBLmNybDAdBgNVHQ4EFgQU -77cjl9CokX+mz6YhwDSfzHdB4dAwHwYDVR0jBBgwFoAU77cjl9CokX+mz6YhwDSf -zHdB4dAwDQYJKoZIhvcNAQELBQADggEBABoxaZlCwuVAhaKfksNj1I8hOagZIf56 -/MNNQPMr6EusW0xZk8bcfguvfF+VhWu9x2+6wb74xjpnS5PGBWk+JC3wG5HGPj/s -QhiTbAMkim75IGcrfG2rNMkqIjMN132P7tI2ZELINZpuGWHLjWfwaKfQJAXmwxe6 -Ra58Q7WAeANNIHMF/EMQnTVpQnWUJYIrpjuQGN7Bqa/zLZW/lafPGJfhWeKirxoW -YQ33E3FTkzf9PK8AHWyLFK9Gloy2UnzMLU7N4elLCu6a/nqY5ym6G9ocutxrzQQO -JkCp63M8/lCoESdVvduOS+9PGO0V/72GmGbumiVxNGxQ8bJRy2adTSk= ------END CERTIFICATE----- diff --git a/make/data/publicsuffixlist/VERSION b/make/data/publicsuffixlist/VERSION index 0f982e7fc97..3367b24a0be 100644 --- a/make/data/publicsuffixlist/VERSION +++ b/make/data/publicsuffixlist/VERSION @@ -1,2 +1,2 @@ -Github: https://raw.githubusercontent.com/publicsuffix/list/33c1c788decfed1052089fa27e3005fe4088dec3/public_suffix_list.dat -Date: 2019-09-28 +Github: https://raw.githubusercontent.com/publicsuffix/list/cbbba1d234670453df9c930dfbf510c0474d4301/public_suffix_list.dat +Date: 2020-04-24 diff --git a/make/data/publicsuffixlist/public_suffix_list.dat b/make/data/publicsuffixlist/public_suffix_list.dat index 88f2f8fcb4f..27fe1ee51b4 100644 --- a/make/data/publicsuffixlist/public_suffix_list.dat +++ b/make/data/publicsuffixlist/public_suffix_list.dat @@ -79,7 +79,6 @@ exchange.aero express.aero federation.aero flight.aero -freight.aero fuel.aero gliding.aero government.aero @@ -213,6 +212,7 @@ ac.at co.at gv.at or.at +sth.ac.at // au : https://en.wikipedia.org/wiki/.au // http://www.auda.org.au/ @@ -241,7 +241,7 @@ wa.au // 3LDs act.edu.au catholic.edu.au -eq.edu.au +// eq.edu.au - Removed at the request of the Queensland Department of Education nsw.edu.au nt.edu.au qld.edu.au @@ -719,11 +719,13 @@ gouv.ci *.ck !www.ck -// cl : https://en.wikipedia.org/wiki/.cl +// cl : https://www.nic.cl +// Confirmed by .CL registry cl -gov.cl -gob.cl +aprendemas.cl co.cl +gob.cl +gov.cl mil.cl // cm : https://en.wikipedia.org/wiki/.cm plus bug 981927 @@ -982,8 +984,19 @@ fi // TODO: Check for updates (expected to be phased out around Q1/2009) aland.fi -// fj : https://en.wikipedia.org/wiki/.fj -*.fj +// fj : http://domains.fj/ +// Submitted by registry 2020-02-11 +fj +ac.fj +biz.fj +com.fj +gov.fj +info.fj +mil.fj +name.fj +net.fj +org.fj +pro.fj // fk : https://en.wikipedia.org/wiki/.fk *.fk @@ -1368,7 +1381,7 @@ it gov.it edu.it // Reserved geo-names (regions and provinces): -// http://www.nic.it/sites/default/files/docs/Regulation_assignation_v7.1.pdf +// https://www.nic.it/sites/default/files/archivio/docs/Regulation_assignation_v7.1.pdf // Regions abr.it abruzzo.it @@ -5886,14 +5899,9 @@ gov.rs in.rs org.rs -// ru : https://cctld.ru/en/domains/domens_ru/reserved/ +// ru : https://cctld.ru/files/pdf/docs/en/rules_ru-rf.pdf +// Submitted by George Georgievsky ru -ac.ru -edu.ru -gov.ru -int.ru -mil.ru -test.ru // rw : https://www.ricta.org.rw/sites/default/files/resources/registry_registrar_contract_0.pdf rw @@ -6038,9 +6046,12 @@ org.sn perso.sn univ.sn -// so : http://www.soregistry.com/ +// so : http://sonic.so/policies/ so com.so +edu.so +gov.so +me.so net.so org.so @@ -6510,7 +6521,7 @@ k12.ok.us k12.or.us k12.pa.us k12.pr.us -k12.ri.us +// k12.ri.us Removed at request of Kim Cournoyer k12.sc.us // k12.sd.us Bug 934131 - Removed at request of James Booze k12.tn.us @@ -6797,8 +6808,13 @@ yt مصر // xn--e1a4c ("eu", Cyrillic) : EU +// https://eurid.eu ею +// xn--qxa6a ("eu", Greek) : EU +// https://eurid.eu +ευ + // xn--mgbah1a3hjkrd ("Mauritania", Arabic) : MR موريتانيا @@ -6955,7 +6971,8 @@ yt ак.срб // xn--p1ai ("rf", Russian-Cyrillic) : RU -// http://www.cctld.ru/en/docs/rulesrf.php +// https://cctld.ru/files/pdf/docs/en/rules_ru-rf.pdf +// Submitted by George Georgievsky рф // xn--wgbl6a ("Qatar", Arabic) : QA @@ -7075,7 +7092,7 @@ org.zw // newGTLDs -// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2019-09-26T16:43:02Z +// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2020-04-02T18:20:31Z // This list is auto-generated, don't edit it manually. // aaa : 2015-02-26 American Automobile Association, Inc. aaa @@ -7197,6 +7214,9 @@ alsace // alstom : 2015-07-30 ALSTOM alstom +// amazon : 2019-12-19 Amazon Registry Services, Inc. +amazon + // americanexpress : 2015-07-31 American Express Travel Related Services Company, Inc. americanexpress @@ -7296,7 +7316,7 @@ auto // autos : 2014-01-09 DERAutos, LLC autos -// avianca : 2015-01-08 Aerovias del Continente Americano S.A. Avianca +// avianca : 2015-01-08 Avianca Holdings S.A. avianca // aws : 2015-06-25 Amazon Registry Services, Inc. @@ -7374,7 +7394,7 @@ bcn // beats : 2015-05-14 Beats Electronics, LLC beats -// beauty : 2015-12-03 L'Oréal +// beauty : 2015-12-03 XYZ.COM LLC beauty // beer : 2014-01-09 Minds + Machines Group Limited @@ -7587,9 +7607,6 @@ careers // cars : 2014-11-13 Cars Registry Limited cars -// cartier : 2014-06-23 Richemont DNS Inc. -cartier - // casa : 2013-11-21 Minds + Machines Group Limited casa @@ -7668,9 +7685,6 @@ christmas // chrome : 2014-07-24 Charleston Road Registry Inc. chrome -// chrysler : 2015-07-30 FCA US LLC. -chrysler - // church : 2014-02-06 Binky Moon, LLC church @@ -7836,7 +7850,7 @@ cuisinella // cymru : 2014-05-08 Nominet UK cymru -// cyou : 2015-01-22 Beijing Gamease Age Digital Technology Co., Ltd. +// cyou : 2015-01-22 ShortDot SA cyou // dabur : 2014-02-06 Dabur India Limited @@ -7950,9 +7964,6 @@ docs // doctor : 2016-06-02 Binky Moon, LLC doctor -// dodge : 2015-07-30 FCA US LLC. -dodge - // dog : 2014-12-04 Binky Moon, LLC dog @@ -8058,9 +8069,6 @@ eus // events : 2013-12-05 Binky Moon, LLC events -// everbank : 2014-05-15 EverBank -everbank - // exchange : 2014-03-06 Binky Moon, LLC exchange @@ -8334,7 +8342,7 @@ gmail // gmbh : 2016-01-29 Binky Moon, LLC gmbh -// gmo : 2014-01-09 GMO Internet Pte. Ltd. +// gmo : 2014-01-09 GMO Internet, Inc. gmo // gmx : 2014-04-24 1&1 Mail & Media GmbH @@ -8409,7 +8417,7 @@ guitars // guru : 2013-08-27 Binky Moon, LLC guru -// hair : 2015-12-03 L'Oréal +// hair : 2015-12-03 XYZ.COM LLC hair // hamburg : 2014-02-20 Hamburg Top-Level-Domain GmbH @@ -8745,9 +8753,6 @@ kyoto // lacaixa : 2014-01-09 Fundación Bancaria Caixa d’Estalvis i Pensions de Barcelona, “la Caixa” lacaixa -// ladbrokes : 2015-08-06 LADBROKES INTERNATIONAL PLC -ladbrokes - // lamborghini : 2015-06-04 Automobili Lamborghini S.p.A. lamborghini @@ -8760,9 +8765,6 @@ lancaster // lancia : 2015-07-31 Fiat Chrysler Automobiles N.V. lancia -// lancome : 2015-07-23 L'Oréal -lancome - // land : 2013-09-10 Binky Moon, LLC land @@ -8814,9 +8816,6 @@ lexus // lgbt : 2014-05-08 Afilias Limited lgbt -// liaison : 2014-10-02 Liaison Technologies, Incorporated -liaison - // lidl : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG lidl @@ -8937,7 +8936,7 @@ maif // maison : 2013-12-05 Binky Moon, LLC maison -// makeup : 2015-01-15 L'Oréal +// makeup : 2015-01-15 XYZ.COM LLC makeup // man : 2014-12-04 MAN SE @@ -9060,9 +9059,6 @@ money // monster : 2015-09-11 XYZ.COM LLC monster -// mopar : 2015-07-30 FCA US LLC. -mopar - // mormon : 2013-12-05 IRI Domain Management, LLC ("Applicant") mormon @@ -9084,9 +9080,6 @@ mov // movie : 2015-02-05 Binky Moon, LLC movie -// movistar : 2014-10-16 Telefónica S.A. -movistar - // msd : 2015-07-23 MSD Registry Holdings, Inc. msd @@ -9102,9 +9095,6 @@ mutual // nab : 2015-08-20 National Australia Bank Limited nab -// nadex : 2014-12-11 Nadex Domains, Inc. -nadex - // nagoya : 2013-10-24 GMO Registry, Inc. nagoya @@ -9345,9 +9335,6 @@ photos // physio : 2014-05-01 PhysBiz Pty Ltd physio -// piaget : 2014-10-16 Richemont DNS Inc. -piaget - // pics : 2013-11-14 Uniregistry, Corp. pics @@ -9459,7 +9446,7 @@ qpon // quebec : 2013-12-19 PointQuébec Inc quebec -// quest : 2015-03-26 Quest ION Limited +// quest : 2015-03-26 XYZ.COM LLC quest // qvc : 2015-07-30 QVC, Inc. @@ -9789,7 +9776,7 @@ site // ski : 2015-04-09 Afilias Limited ski -// skin : 2015-01-15 L'Oréal +// skin : 2015-01-15 XYZ.COM LLC skin // sky : 2014-06-19 Sky International AG @@ -9858,9 +9845,6 @@ spreadbetting // srl : 2015-05-07 InterNetX, Corp srl -// srt : 2015-07-30 FCA US LLC. -srt - // stada : 2014-11-13 STADA Arzneimittel AG stada @@ -9987,9 +9971,6 @@ tech // technology : 2013-09-13 Binky Moon, LLC technology -// telefonica : 2014-10-16 Telefónica S.A. -telefonica - // temasek : 2014-08-07 Temasek Holdings (Private) Limited temasek @@ -10083,7 +10064,7 @@ trading // training : 2013-11-07 Binky Moon, LLC training -// travel : Dog Beach, LLC +// travel : 2015-10-09 Dog Beach, LLC travel // travelchannel : 2015-07-02 Lifestyle Domain Holdings, Inc. @@ -10122,9 +10103,6 @@ ubank // ubs : 2014-12-11 UBS AG ubs -// uconnect : 2015-07-30 FCA US LLC. -uconnect - // unicom : 2015-10-15 China United Network Communications Corporation Limited unicom @@ -10194,9 +10172,6 @@ visa // vision : 2013-12-05 Binky Moon, LLC vision -// vistaprint : 2014-09-18 Vistaprint Limited -vistaprint - // viva : 2014-11-07 Saudi Telecom Company viva @@ -10245,9 +10220,6 @@ wang // wanggou : 2014-12-18 Amazon Registry Services, Inc. wanggou -// warman : 2015-06-18 Weir Group IP Limited -warman - // watch : 2013-11-14 Binky Moon, LLC watch @@ -10362,7 +10334,7 @@ xin // xn--3bst00m : 2013-09-13 Eagle Horizon Limited 集团 -// xn--3ds443g : 2013-09-08 TLD REGISTRY LIMITED +// xn--3ds443g : 2013-09-08 TLD REGISTRY LIMITED OY 在线 // xn--3oq18vl8pn36a : 2015-07-02 Volkswagen (China) Investment Co., Ltd. @@ -10377,7 +10349,7 @@ xin // xn--45q11c : 2013-11-21 Zodiac Gemini Ltd 八卦 -// xn--4gbrim : 2013-10-04 Suhub Electronic Establishment +// xn--4gbrim : 2013-10-04 Fans TLD Limited موقع // xn--55qw42g : 2013-11-08 China Organizational Name Administration Center @@ -10437,10 +10409,13 @@ xin // xn--cck2b3b : 2015-02-26 Amazon Registry Services, Inc. ストア +// xn--cckwcxetd : 2019-12-19 Amazon Registry Services, Inc. +アマゾン + // xn--cg4bki : 2013-09-27 SAMSUNG SDS CO., LTD 삼성 -// xn--czr694b : 2014-01-16 Dot Trademark TLD Holding Company Limited +// xn--czr694b : 2014-01-16 Internet DotTrademark Organisation Limited 商标 // xn--czrs0t : 2013-12-19 Binky Moon, LLC @@ -10458,16 +10433,13 @@ xin // xn--efvy88h : 2014-08-22 Guangzhou YU Wei Information Technology Co., Ltd. 新闻 -// xn--estv75g : 2015-02-19 Industrial and Commercial Bank of China Limited -工行 - // xn--fct429k : 2015-04-09 Amazon Registry Services, Inc. 家電 // xn--fhbei : 2015-01-15 VeriSign Sarl كوم -// xn--fiq228c5hs : 2013-09-08 TLD REGISTRY LIMITED +// xn--fiq228c5hs : 2013-09-08 TLD REGISTRY LIMITED OY 中文网 // xn--fiq64b : 2013-10-14 CITIC Group Corporation @@ -10497,7 +10469,7 @@ xin // xn--i1b6b1a6a2e : 2013-11-14 Public Interest Registry संगठन -// xn--imr513n : 2014-12-11 Dot Trademark TLD Holding Company Limited +// xn--imr513n : 2014-12-11 Internet DotTrademark Organisation Limited 餐厅 // xn--io0a7i : 2013-11-14 China Internet Network Information Center (CNNIC) @@ -10506,6 +10478,9 @@ xin // xn--j1aef : 2015-01-15 VeriSign Sarl ком +// xn--jlq480n2rg : 2019-12-19 Amazon Registry Services, Inc. +亚马逊 + // xn--jlq61u9w7b : 2015-01-08 Nokia Corporation 诺基亚 @@ -10566,7 +10541,7 @@ xin // xn--nyqy26a : 2014-11-07 Stable Tone Limited 健康 -// xn--otu796d : 2017-08-06 Dot Trademark TLD Holding Company Limited +// xn--otu796d : 2017-08-06 Jiang Yu Liang Cai Technology Company Limited 招聘 // xn--p1acf : 2013-12-12 Rusnames Limited @@ -10641,7 +10616,7 @@ yahoo // yamaxun : 2014-12-18 Amazon Registry Services, Inc. yamaxun -// yandex : 2014-04-10 YANDEX, LLC +// yandex : 2014-04-10 Yandex Europe B.V. yandex // yodobashi : 2014-11-20 YODOBASHI CAMERA CO.,LTD. @@ -10691,6 +10666,12 @@ cc.ua inf.ua ltd.ua +// Adobe : https://www.adobe.com/ +// Submitted by Ian Boston +adobeaemcloud.com +adobeaemcloud.net +*.dev.adobeaemcloud.com + // Agnat sp. z o.o. : https://domena.pl // Submitted by Przemyslaw Plewa beep.pl @@ -10808,6 +10789,10 @@ s3-website.eu-west-2.amazonaws.com s3-website.eu-west-3.amazonaws.com s3-website.us-east-2.amazonaws.com +// Amsterdam Wireless: https://www.amsterdamwireless.nl/ +// Submitted by Imre Jonk +amsw.nl + // Amune : https://amune.org/ // Submitted by Team Amune t3l3p0rt.net @@ -10842,12 +10827,6 @@ sweetpepper.org // Submitted by Vincent Tseng myasustor.com -// Automattic Inc. : https://automattic.com/ -// Submitted by Alex Concha -go-vip.co -go-vip.net -wpcomstaging.com - // AVM : https://avm.de // Submitted by Andreas Weise myfritz.net @@ -10984,8 +10963,9 @@ certmgr.org xenapponazure.com // Civilized Discourse Construction Kit, Inc. : https://www.discourse.org/ -// Submitted by Rishabh Nambiar +// Submitted by Rishabh Nambiar & Michael Brown discourse.group +discourse.team // ClearVox : http://www.clearvox.nl/ // Submitted by Leon Rowland @@ -11000,6 +10980,10 @@ cleverapps.io *.lcl.dev *.stg.dev +// Clic2000 : https://clic2000.fr +// Submitted by Mathilde Blanchemanche +clic2000.net + // Cloud66 : https://www.cloud66.com/ // Submitted by Khash Sajadi c66.me @@ -11082,6 +11066,15 @@ co.no webhosting.be hosting-cluster.nl +// Coordination Center for TLD RU and XN--P1AI : https://cctld.ru/en/domains/domens_ru/reserved/ +// Submitted by George Georgievsky +ac.ru +edu.ru +gov.ru +int.ru +mil.ru +test.ru + // COSIMO GmbH : http://www.cosimo.de // Submitted by Rene Marticke dyn.cosidns.de @@ -11106,6 +11099,18 @@ realm.cz // Submitted by Jonathan Rudenberg cupcake.is +// Curv UG : https://curv-labs.de/ +// Submitted by Marvin Wiesner +curv.dev + +// Customer OCI - Oracle Dyn https://cloud.oracle.com/home https://dyn.com/dns/ +// Submitted by Gregory Drake +// Note: This is intended to also include customer-oci.com due to wildcards implicitly including the current label +*.customer-oci.com +*.oci.customer-oci.com +*.ocp.customer-oci.com +*.ocs.customer-oci.com + // cyon GmbH : https://www.cyon.ch/ // Submitted by Dominic Luechinger cyon.link @@ -11133,11 +11138,23 @@ firm.dk reg.dk store.dk +// dappnode.io : https://dappnode.io/ +// Submitted by Abel Boldu / DAppNode Team +dyndns.dappnode.io + // dapps.earth : https://dapps.earth/ // Submitted by Daniil Burdakov *.dapps.earth *.bzz.dapps.earth +// Dark, Inc. : https://darklang.com +// Submitted by Paul Biggar +builtwithdark.com + +// Datawire, Inc : https://www.datawire.io +// Submitted by Richard Li +edgestack.me + // Debian : https://www.debian.org/ // Submitted by Peter Palfrader / Debian Sysadmin Team debian.net @@ -11511,6 +11528,10 @@ dynv6.net // Submitted by Vladimir Dudr e4.cz +// En root‽ : https://en-root.org +// Submitted by Emmanuel Raviart +en-root.fr + // Enalean SAS: https://www.enalean.com // Submitted by Thomas Cottier mytuleap.com @@ -11603,6 +11624,10 @@ twmail.org mymailer.com.tw url.tw +// Fabrica Technologies, Inc. : https://www.fabrica.dev/ +// Submitted by Eric Jiang +onfabrica.com + // Facebook, Inc. // Submitted by Peter Ruibal apps.fbsbx.com @@ -11686,6 +11711,7 @@ vologda.su // Fancy Bits, LLC : http://getchannels.com // Submitted by Aman Gupta channelsdvr.net +u.channelsdvr.net // Fastly Inc. : http://www.fastly.com/ // Submitted by Fastly Security @@ -11704,6 +11730,10 @@ global.ssl.fastly.net // Submitted by Likhachev Vasiliy fastpanel.direct fastvps-server.com +myfast.space +myfast.host +fastvps.site +fastvps.host // Featherhead : https://featherhead.xyz/ // Submitted by Simon Menke @@ -11717,6 +11747,13 @@ cloud.fedoraproject.org app.os.fedoraproject.org app.os.stg.fedoraproject.org +// FearWorks Media Ltd. : https://fearworksmedia.co.uk +// submitted by Keith Fairley +conn.uk +copro.uk +couk.me +ukco.me + // Fermax : https://fermax.com/ // submitted by Koen Van Isterdael mydobiss.com @@ -11737,9 +11774,12 @@ firebaseapp.com // Flynn : https://flynn.io // Submitted by Jonathan Rudenberg -flynnhub.com flynnhosting.net +// Frederik Braun https://frederik-braun.com +// Submitted by Frederik Braun +0e.vc + // Freebox : http://www.freebox.fr // Submitted by Romain Fliedel freebox-os.com @@ -11773,8 +11813,9 @@ service.gov.uk gehirn.ne.jp usercontent.jp -// Gentlent, Limited : https://www.gentlent.com -// Submitted by Tom Klein +// Gentlent, Inc. : https://www.gentlent.com +// Submitted by Tom Klein +gentapps.com lab.ms // GitHub, Inc. @@ -11819,6 +11860,7 @@ a.run.app web.app *.0emm.com appspot.com +*.r.appspot.com blogspot.ae blogspot.al blogspot.am @@ -11903,6 +11945,14 @@ publishproxy.com withgoogle.com withyoutube.com +// Aaron Marais' Gitlab pages: https://lab.aaronleem.co.za +// Submitted by Aaron Marais +graphox.us + +// Group 53, LLC : https://www.group53.com +// Submitted by Tyler Todd +awsmppl.com + // Hakaran group: http://hakaran.cz // Submited by Arseniy Sokolov fin.ci @@ -11952,6 +12002,7 @@ col.ng firm.ng gen.ng ltd.ng +ngo.ng ng.school sch.so @@ -12028,8 +12079,9 @@ pixolino.com ipifony.net // IServ GmbH : https://iserv.eu -// Submitted by Kim-Alexander Brodowski +// Submitted by Kim-Alexander Brodowski mein-iserv.de +schulserver.de test-iserv.de iserv.dev @@ -12072,6 +12124,10 @@ uni5.net // Submitted by Roy Keene knightpoint.systems +// KUROKU LTD : https://kuroku.ltd/ +// Submitted by DisposaBoy +oya.to + // .KRD : http://nic.krd/data/krd/Registration%20Policy.pdf co.krd edu.krd @@ -12211,8 +12267,8 @@ eu.meteorapp.com co.pl // Microsoft Corporation : http://microsoft.com -// Submitted by Justin Luk -azurecontainer.io +// Submitted by Mostafa Elzeiny +*.azurecontainer.io azurewebsites.net azure-mobile.net cloudapp.net @@ -12258,6 +12314,7 @@ nctu.me // Netlify : https://www.netlify.com // Submitted by Jessica Parsons bitballoon.com +netlify.app netlify.com // Neustar Inc. @@ -12415,12 +12472,13 @@ pcloud.host nyc.mn // NymNom : https://nymnom.com/ -// Submitted by Dave McCormack +// Submitted by NymNom nom.ae nom.af nom.ai nom.al nym.by +nom.bz nym.bz nom.cl nym.ec @@ -12442,6 +12500,7 @@ nom.li nym.li nym.lt nym.lu +nom.lv nym.me nom.mk nym.mn @@ -12466,6 +12525,10 @@ nom.uy nom.vc nom.vg +// Observable, Inc. : https://observablehq.com +// Submitted by Mike Bostock +static.observableusercontent.com + // Octopodal Solutions, LLC. : https://ulterius.io/ // Submitted by Andrew Sampson cya.gg @@ -12486,6 +12549,10 @@ opencraft.hosting // Submitted by Yngve Pettersen operaunite.com +// Oursky Limited : https://skygear.io/ +// Submited by Skygear Developer +skygearapp.com + // OutSystems // Submitted by Duarte Santos outsystemscloud.com @@ -12528,6 +12595,10 @@ gotpantheon.com // Submitted by Steve Leung mypep.link +// Perspecta : https://perspecta.com/ +// Submitted by Kenneth Van Alstyne +perspecta.cloud + // Planet-Work : https://www.planet-work.com/ // Submitted by Frédéric VANNIÈRE on-web.fr @@ -12537,6 +12608,12 @@ on-web.fr *.platform.sh *.platformsh.site +// Platter: https://platter.dev +// Submitted by Patrick Flor +platter-app.com +platter-app.dev +platterp.us + // Port53 : https://port53.io/ // Submitted by Maximilian Schieder dyn53.io @@ -12578,6 +12655,10 @@ pubtls.org // Submitted by Xavier De Cock qualifioapp.com +// QuickBackend: https://www.quickbackend.com +// Submitted by Dani Biro +qbuser.com + // Redstar Consultants : https://www.redstarconsultants.com/ // Submitted by Jons Slemmer instantcloud.cn @@ -12590,6 +12671,11 @@ ras.ru // Submitted by Daniel Dent (https://www.danieldent.com/) qa2.com +// QCX +// Submitted by Cassandra Beelen +qcx.io +*.sys.qcx.io + // QNAP System Inc : https://www.qnap.com // Submitted by Nick Chang dev-myqnapcloud.com @@ -12612,6 +12698,7 @@ rackmaze.net // Rancher Labs, Inc : https://rancher.com // Submitted by Vincent Fiduccia +*.on-k3s.io *.on-rancher.cloud *.on-rio.io @@ -12665,6 +12752,10 @@ logoip.com // Submitted by Hanno Böck schokokeks.net +// Scottish Government: https://www.gov.scot +// Submitted by Martin Ellis +gov.scot + // Scry Security : http://www.scrysec.com // Submitted by Shante Adam scrysec.com @@ -12682,6 +12773,10 @@ my-firewall.org myfirewall.org spdns.org +// Senseering GmbH : https://www.senseering.de +// Submitted by Felix Mönckemeyer +senseering.net + // Service Online LLC : http://drs.ua/ // Submitted by Serhii Bulakh biz.ua @@ -12700,6 +12795,10 @@ myshopblocks.com // Submitted by Craig McMahon shopitsite.com +// shopware AG : https://shopware.com +// Submitted by Jens Küper +shopware.store + // Siemens Mobility GmbH // Submitted by Oliver Graebner mo-siemens.io @@ -12732,6 +12831,10 @@ static.land dev.static.land sites.static.land +// Sony Interactive Entertainment LLC : https://sie.com/ +// Submitted by David Coles +playstation-cloud.com + // SourceLair PC : https://www.sourcelair.com // Submitted by Antonis Kalipetis apps.lair.io @@ -12906,6 +13009,11 @@ inc.hk virtualuser.de virtual-user.de +// urown.net : https://urown.net +// Submitted by Hostmaster +urown.cloud +dnsupdate.info + // .US // Submitted by Ed Moore lib.de.us @@ -12926,6 +13034,10 @@ v-info.info // Submitted by Nathan van Bakel voorloper.cloud +// V.UA Domain Administrator : https://domain.v.ua/ +// Submitted by Serhii Rostilo +v.ua + // Waffle Computer Inc., Ltd. : https://docs.waffleinfo.com // Submitted by Masayuki Note wafflecell.com @@ -12945,8 +13057,23 @@ wedeploy.sh remotewd.com // Wikimedia Labs : https://wikitech.wikimedia.org -// Submitted by Yuvi Panda +// Submitted by Arturo Borrero Gonzalez wmflabs.org +toolforge.org +wmcloud.org + +// WISP : https://wisp.gg +// Submitted by Stepan Fedotov +panel.gg +daemon.panel.gg + +// WoltLab GmbH : https://www.woltlab.com +// Submitted by Tim Düsterhus +myforum.community +community-pro.de +diskussionsbereich.de +community-pro.net +meinforum.net // XenonCloud GbR: https://xenoncloud.net // Submitted by Julian Uphoff @@ -13010,7 +13137,10 @@ bss.design // Submitted by Emil Stahl basicserver.io virtualserver.io -site.builder.nu enterprisecloud.nu +// Mintere : https://mintere.com/ +// Submitted by Ben Aubin +mintere.site + // ===END PRIVATE DOMAINS=== diff --git a/make/data/tzdata/VERSION b/make/data/tzdata/VERSION index 1be80d5b5f6..e96a6d78497 100644 --- a/make/data/tzdata/VERSION +++ b/make/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2019c +tzdata2020a diff --git a/make/data/tzdata/africa b/make/data/tzdata/africa index cfce2ca8df9..7947bc55b00 100644 --- a/make/data/tzdata/africa +++ b/make/data/tzdata/africa @@ -890,19 +890,25 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # Morocco will be on GMT starting from Sunday, May 5th 2019 at 3am. # The switch to GMT+1 will occur on Sunday, June 9th 2019 at 2am.... # http://fr.le360.ma/societe/voici-la-date-du-retour-a-lheure-legale-au-maroc-188222 -# -# From Paul Eggert (2019-05-20): -# This agrees with our 2018-11-01 guess that the Moroccan government -# would continue the practice of falling back at 03:00 the last Sunday -# before Ramadan, and of springing forward at 02:00 the first Sunday after -# Ramadan, as this has been the practice since 2012. To implement this, -# transition dates for 2019 through 2087 were determined by running the -# following program under GNU Emacs 26.2. -# (let ((islamic-year 1440)) + +# From Semlali Naoufal (2020-04-14): +# Following the announcement by the Moroccan government, the switch to +# GMT time will take place on Sunday, April 19, 2020 from 3 a.m. and +# the return to GMT+1 time will take place on Sunday, May 31, 2020 at 2 a.m.... +# https://maroc-diplomatique.net/maroc-le-retour-a-lheure-gmt-est-prevu-dimanche-prochain/ +# http://aujourdhui.ma/actualite/gmt1-retour-a-lheure-normale-dimanche-prochain-1 +# +# From Paul Eggert (2020-04-14): +# For now, guess that in the future Morocco will fall back at 03:00 +# the last Sunday before Ramadan, and spring forward at 02:00 the +# first Sunday after the day after Ramadan. To implement this, +# transition dates for 2021 through 2087 were determined by running +# the following program under GNU Emacs 26.3. +# (let ((islamic-year 1442)) # (require 'cal-islam) # (while (< islamic-year 1511) # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) -# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (b (1+ (calendar-islamic-to-absolute (list 10 1 islamic-year)))) # (sunday 0)) # (while (/= sunday (mod (setq a (1- a)) 7))) # (while (/= sunday (mod b 7)) @@ -962,7 +968,7 @@ Rule Morocco 2018 only - Jun 17 2:00 1:00 - Rule Morocco 2019 only - May 5 3:00 -1:00 - Rule Morocco 2019 only - Jun 9 2:00 0 - Rule Morocco 2020 only - Apr 19 3:00 -1:00 - -Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2020 only - May 31 2:00 0 - Rule Morocco 2021 only - Apr 11 3:00 -1:00 - Rule Morocco 2021 only - May 16 2:00 0 - Rule Morocco 2022 only - Mar 27 3:00 -1:00 - @@ -978,7 +984,7 @@ Rule Morocco 2026 only - Mar 22 2:00 0 - Rule Morocco 2027 only - Feb 7 3:00 -1:00 - Rule Morocco 2027 only - Mar 14 2:00 0 - Rule Morocco 2028 only - Jan 23 3:00 -1:00 - -Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2028 only - Mar 5 2:00 0 - Rule Morocco 2029 only - Jan 14 3:00 -1:00 - Rule Morocco 2029 only - Feb 18 2:00 0 - Rule Morocco 2029 only - Dec 30 3:00 -1:00 - @@ -994,7 +1000,7 @@ Rule Morocco 2033 only - Dec 25 2:00 0 - Rule Morocco 2034 only - Nov 5 3:00 -1:00 - Rule Morocco 2034 only - Dec 17 2:00 0 - Rule Morocco 2035 only - Oct 28 3:00 -1:00 - -Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2035 only - Dec 9 2:00 0 - Rule Morocco 2036 only - Oct 19 3:00 -1:00 - Rule Morocco 2036 only - Nov 23 2:00 0 - Rule Morocco 2037 only - Oct 4 3:00 -1:00 - @@ -1010,7 +1016,7 @@ Rule Morocco 2041 only - Sep 29 2:00 0 - Rule Morocco 2042 only - Aug 10 3:00 -1:00 - Rule Morocco 2042 only - Sep 21 2:00 0 - Rule Morocco 2043 only - Aug 2 3:00 -1:00 - -Rule Morocco 2043 only - Sep 6 2:00 0 - +Rule Morocco 2043 only - Sep 13 2:00 0 - Rule Morocco 2044 only - Jul 24 3:00 -1:00 - Rule Morocco 2044 only - Aug 28 2:00 0 - Rule Morocco 2045 only - Jul 9 3:00 -1:00 - @@ -1026,7 +1032,7 @@ Rule Morocco 2049 only - Jul 4 2:00 0 - Rule Morocco 2050 only - May 15 3:00 -1:00 - Rule Morocco 2050 only - Jun 26 2:00 0 - Rule Morocco 2051 only - May 7 3:00 -1:00 - -Rule Morocco 2051 only - Jun 11 2:00 0 - +Rule Morocco 2051 only - Jun 18 2:00 0 - Rule Morocco 2052 only - Apr 28 3:00 -1:00 - Rule Morocco 2052 only - Jun 2 2:00 0 - Rule Morocco 2053 only - Apr 13 3:00 -1:00 - @@ -1042,7 +1048,7 @@ Rule Morocco 2057 only - Apr 8 2:00 0 - Rule Morocco 2058 only - Feb 17 3:00 -1:00 - Rule Morocco 2058 only - Mar 31 2:00 0 - Rule Morocco 2059 only - Feb 9 3:00 -1:00 - -Rule Morocco 2059 only - Mar 16 2:00 0 - +Rule Morocco 2059 only - Mar 23 2:00 0 - Rule Morocco 2060 only - Feb 1 3:00 -1:00 - Rule Morocco 2060 only - Mar 7 2:00 0 - Rule Morocco 2061 only - Jan 16 3:00 -1:00 - @@ -1052,13 +1058,13 @@ Rule Morocco 2062 only - Feb 12 2:00 0 - Rule Morocco 2062 only - Dec 31 3:00 -1:00 - Rule Morocco 2063 only - Feb 4 2:00 0 - Rule Morocco 2063 only - Dec 16 3:00 -1:00 - -Rule Morocco 2064 only - Jan 20 2:00 0 - +Rule Morocco 2064 only - Jan 27 2:00 0 - Rule Morocco 2064 only - Dec 7 3:00 -1:00 - Rule Morocco 2065 only - Jan 11 2:00 0 - Rule Morocco 2065 only - Nov 22 3:00 -1:00 - Rule Morocco 2066 only - Jan 3 2:00 0 - Rule Morocco 2066 only - Nov 14 3:00 -1:00 - -Rule Morocco 2066 only - Dec 19 2:00 0 - +Rule Morocco 2066 only - Dec 26 2:00 0 - Rule Morocco 2067 only - Nov 6 3:00 -1:00 - Rule Morocco 2067 only - Dec 11 2:00 0 - Rule Morocco 2068 only - Oct 21 3:00 -1:00 - @@ -1068,13 +1074,13 @@ Rule Morocco 2069 only - Nov 17 2:00 0 - Rule Morocco 2070 only - Oct 5 3:00 -1:00 - Rule Morocco 2070 only - Nov 9 2:00 0 - Rule Morocco 2071 only - Sep 20 3:00 -1:00 - -Rule Morocco 2071 only - Oct 25 2:00 0 - +Rule Morocco 2071 only - Nov 1 2:00 0 - Rule Morocco 2072 only - Sep 11 3:00 -1:00 - Rule Morocco 2072 only - Oct 16 2:00 0 - Rule Morocco 2073 only - Aug 27 3:00 -1:00 - Rule Morocco 2073 only - Oct 8 2:00 0 - Rule Morocco 2074 only - Aug 19 3:00 -1:00 - -Rule Morocco 2074 only - Sep 23 2:00 0 - +Rule Morocco 2074 only - Sep 30 2:00 0 - Rule Morocco 2075 only - Aug 11 3:00 -1:00 - Rule Morocco 2075 only - Sep 15 2:00 0 - Rule Morocco 2076 only - Jul 26 3:00 -1:00 - @@ -1084,7 +1090,7 @@ Rule Morocco 2077 only - Aug 22 2:00 0 - Rule Morocco 2078 only - Jul 10 3:00 -1:00 - Rule Morocco 2078 only - Aug 14 2:00 0 - Rule Morocco 2079 only - Jun 25 3:00 -1:00 - -Rule Morocco 2079 only - Jul 30 2:00 0 - +Rule Morocco 2079 only - Aug 6 2:00 0 - Rule Morocco 2080 only - Jun 16 3:00 -1:00 - Rule Morocco 2080 only - Jul 21 2:00 0 - Rule Morocco 2081 only - Jun 1 3:00 -1:00 - @@ -1100,7 +1106,7 @@ Rule Morocco 2085 only - May 27 2:00 0 - Rule Morocco 2086 only - Apr 14 3:00 -1:00 - Rule Morocco 2086 only - May 19 2:00 0 - Rule Morocco 2087 only - Mar 30 3:00 -1:00 - -Rule Morocco 2087 only - May 4 2:00 0 - +Rule Morocco 2087 only - May 11 2:00 0 - # For dates after the somewhat-arbitrary cutoff of 2087, assume that # Morocco will no longer observe DST. At some point this table will # need to be extended, though quite possibly Morocco will change the @@ -1202,7 +1208,7 @@ Link Africa/Maputo Africa/Lusaka # Zambia Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT -# Rearguard section, for parsers that do not support negative DST. +# Rearguard section, for parsers lacking negative DST; see ziguard.awk. #Rule Namibia 1994 only - Mar 21 0:00 0 WAT #Rule Namibia 1994 2017 - Sep Sun>=1 2:00 1:00 CAT #Rule Namibia 1995 2017 - Apr Sun>=1 2:00 0 WAT @@ -1216,7 +1222,7 @@ Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 2:00 - SAST 1990 Mar 21 # independence # Vanguard section, for zic and other parsers that support negative DST. 2:00 Namibia %s -# Rearguard section, for parsers that do not support negative DST. +# Rearguard section, for parsers lacking negative DST; see ziguard.awk. # 2:00 - CAT 1994 Mar 21 0:00 # From Paul Eggert (2017-04-07): # The official date of the 2017 rule change was 2017-10-24. See: diff --git a/make/data/tzdata/asia b/make/data/tzdata/asia index 63a0ef7b4be..0700aa46b41 100644 --- a/make/data/tzdata/asia +++ b/make/data/tzdata/asia @@ -309,6 +309,27 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon # China +# From Phake Nick (2020-04-15): +# According to this news report: +# http://news.sina.com.cn/c/2004-09-01/19524201403.shtml +# on April 11, 1919, newspaper in Shanghai said clocks in Shanghai will spring +# forward for an hour starting from midnight of that Saturday. The report did +# not mention what happened in Shanghai thereafter, but it mentioned that a +# similar trial in Tianjin which ended at October 1st as citizens are told to +# recede the clock on September 30 from 12:00pm to 11:00pm. The trial at +# Tianjin got terminated in 1920. +# +# From Paul Eggert (2020-04-15): +# The Returns of Trade and Trade Reports, page 711, says "Daylight saving was +# given a trial during the year, and from the 12th April to the 1st October +# the clocks were all set one hour ahead of sun time. Though the scheme was +# generally esteemed a success, it was announced early in 1920 that it would +# not be repeated." +# +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Shang 1919 only - Apr 12 24:00 1:00 D +Rule Shang 1919 only - Sep 30 24:00 0 S + # From Paul Eggert (2018-10-02): # The following comes from Table 1 of: # Li Yu. Research on the daylight saving movement in 1940s Shanghai. @@ -317,6 +338,89 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon # The table lists dates only; I am guessing 00:00 and 24:00 transition times. # Also, the table lists the planned end of DST in 1949, but the corresponding # zone line cuts this off on May 28, when the Communists took power. + +# From Phake Nick (2020-04-15): +# +# For the history of time in Shanghai between 1940-1942, the situation is +# actually slightly more complex than the table [below].... At the time, +# there were three different authorities in Shanghai, including Shanghai +# International Settlement, a settlement established by western countries with +# its own westernized form of government, Shanghai French Concession, similar +# to the international settlement but is controlled by French, and then the +# rest of the city of Shanghai, which have already been controlled by Japanese +# force through a puppet local government (Wang Jingwei regime). It was +# additionally complicated by the circumstances that, according to the 1940s +# Shanghai summer time essay cited in the database, some +# departments/businesses/people in the Shanghai city itself during that time +# period, refused to change their clock and instead only changed their opening +# hours. +# +# For example, as quoted in the article, in 1940, other than the authority +# itself, power, tram, bus companies, cinema, department stores, and other +# public service organizations have all decided to follow the summer time and +# spring forward the clock. On the other hand, the custom office refused to +# spring forward the clock because of worry on mechanical wear to the physical +# clock, postal office refused to spring forward because of disruption to +# business and log-keeping, although they did changed their office hour to +# match rest of the city. So is travel agents, and also weather +# observatory. It is said both time standards had their own supporters in the +# city at the time, those who prefer new time standard would have moved their +# clock while those who prefer the old time standard would keep their clock +# unchange, and there were different clocks that use different time standard +# in the city at the time for people who use different time standard to adjust +# their clock to their preferred time. +# +# a. For the 1940 May 31 spring forward, the essay claim that it was +# coordinared between the international settlement authority and the French +# concession authority and have gathered support from Hong Kong and Xiamen, +# that it would spring forward an hour from May 31 "midnight", and the essay +# claim "Hong Kong government implemented the spring forward in the same time +# on the same date as Shanghai". +# +# b. For the 1940 fall back, it was said that they initially intended to do +# so on September 30 00:59 at night, however they postponed it to October 12 +# after discussion with relevant parties. However schools restored to the +# original schedule ten days earlier. +# +# c. For the 1941 spring forward, it is said to start from March 15 +# "following the previous year's method", and in addition to that the essay +# cited an announcement in 1941 from the Wang regime which said the Special +# City of Shanghai under Wang regime control will follow the DST rule set by +# the Settlements, irrespective of the original DST plan announced by the Wang +# regime for other area under its control(April 1 to September 30). (no idea +# to situation before that announcement) +# +# d. For the 1941 fall back, it was said that the fall back would occurs at +# the end of September (A newspaper headline cited by the essay, published on +# October 1, 1941, have the headlines which said "French Concession would +# rewind to the old clock this morning), but it ultimately didn't happen due +# to disagreement between the international settlement authority and the +# French concession authority, and the fall back ultimately occurred on +# November 1. +# +# e. In 1941 December, Japan have officially started war with the United +# States and the United Kingdom, and in Shanghai they have marched into the +# international settlement, taken over its control +# +# f. For the 1942 spring forward, the essay said that the spring forward +# started on January 31. It said this time the custom office and postal +# department will also change their clocks, unlike before. +# +# g. The essay itself didn't cover any specific changes thereafter until the +# end of the war, it quoted a November 1942 command from the government of the +# Wang regime, which claim the daylight saving time applies year round during +# the war. However, the essay ambiguously said the period is "February 1 to +# September 30", which I don't really understand what is the meaning of such +# period in the context of year round implementation here.. More researches +# might be needed to show exactly what happened during that period of time. + +# From Phake Nick (2020-04-15): +# According to a Japanese tour bus pamphlet in Nanjing area believed to be +# from around year 1941: http://www.tt-museum.jp/tairiku_0280_nan1941.html , +# the schedule listed was in the format of Japanese time. Which indicate some +# use of the Japanese time (instead of syncing by DST) might have occurred in +# the Yangtze river delta area during that period of time although the scope +# of such use will need to be investigated to determine. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Shang 1940 only - Jun 1 0:00 1:00 D @@ -595,7 +699,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 6:00 - +06 -# Hong Kong (Xianggang) +# Hong Kong # Milne gives 7:36:41.7; round this. @@ -605,9 +709,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # it is not [an] observatory, but the official meteorological agency of HK, # and also serves as the official timing agency), there are some missing # and incorrect rules. Although the exact switch over time is missing, I -# think 3:30 is correct. The official DST record for Hong Kong can be -# obtained from -# http://www.hko.gov.hk/gts/time/Summertime.htm +# think 3:30 is correct. # From Phake Nick (2018-10-27): # According to Singaporean newspaper @@ -718,10 +820,10 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # Resolution of the Legislative Council passed on 9 May 1979 # https://www.legco.gov.hk/yr78-79/english/lc_sitg/hansard/h790509.pdf#page=39 -# From Paul Eggert (2019-05-31): +# From Paul Eggert (2020-04-15): # Here are the dates given at -# https://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2014-06-19: +# https://www.hko.gov.hk/en/gts/time/Summertime.htm +# as of 2020-02-10: # Year Period # 1941 15 Jun to 30 Sep # 1942 Whole year @@ -1851,6 +1953,47 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # '9:00' and 'JST' is from Guy Harris. +# From Paul Eggert (2020-01-19): +# Starting in the 7th century, Japan generally followed an ancient Chinese +# timekeeping system that divided night and day into six hours each, +# with hour length depending on season. In 1873 the government +# started requiring the use of a Western style 24-hour clock. See: +# Yulia Frumer, "Making Time: Astronomical Time Measurement in Tokugawa Japan" +# . As the tzdb code and +# data support only 24-hour clocks, its tables model timestamps before +# 1873 using Western-style local mean time. + +# From Hideyuki Suzuki (1998-11-09): +# 'Tokyo' usually stands for the former location of Tokyo Astronomical +# Observatory: 139° 44' 40.90" E (9h 18m 58.727s), 35° 39' 16.0" N. +# This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' +# edited by National Astronomical Observatory of Japan.... +# JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). +# The law is enacted on 1886-07-07. + +# From Hideyuki Suzuki (1998-11-16): +# The ordinance No. 51 (1886) established "standard time" in Japan, +# which stands for the time on 135° E. +# In the ordinance No. 167 (1895), "standard time" was renamed to "central +# standard time". And the same ordinance also established "western standard +# time", which stands for the time on 120° E.... But "western standard +# time" was abolished in the ordinance No. 529 (1937). In the ordinance No. +# 167, there is no mention regarding for what place western standard time is +# standard.... +# +# I wrote "ordinance" above, but I don't know how to translate. +# In Japanese it's "chokurei", which means ordinance from emperor. + +# From Yu-Cheng Chuang (2013-07-12): +# ...the Meiji Emperor announced Ordinance No. 167 of Meiji Year 28 "The clause +# about standard time" ... The adoption began from Jan 1, 1896. +# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時) +# +# ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which +# means the whole Japan territory, including later occupations, adopt Japan +# Central Time (UT+9). The adoption began on Oct 1, 1937. +# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件 + # From Paul Eggert (1995-03-06): # Today's _Asahi Evening News_ (page 4) reports that Japan had # daylight saving between 1948 and 1951, but "the system was discontinued @@ -1899,37 +2042,6 @@ Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S Rule Japan 1949 only - Apr Sat>=1 24:00 1:00 D Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D -# From Hideyuki Suzuki (1998-11-09): -# 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139° 44' 40.90" E (9h 18m 58.727s), 35° 39' 16.0" N. -# This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' -# edited by National Astronomical Observatory of Japan.... -# JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). -# The law is enacted on 1886-07-07. - -# From Hideyuki Suzuki (1998-11-16): -# The ordinance No. 51 (1886) established "standard time" in Japan, -# which stands for the time on 135° E. -# In the ordinance No. 167 (1895), "standard time" was renamed to "central -# standard time". And the same ordinance also established "western standard -# time", which stands for the time on 120° E.... But "western standard -# time" was abolished in the ordinance No. 529 (1937). In the ordinance No. -# 167, there is no mention regarding for what place western standard time is -# standard.... -# -# I wrote "ordinance" above, but I don't know how to translate. -# In Japanese it's "chokurei", which means ordinance from emperor. - -# From Yu-Cheng Chuang (2013-07-12): -# ...the Meiji Emperor announced Ordinance No. 167 of Meiji Year 28 "The clause -# about standard time" ... The adoption began from Jan 1, 1896. -# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時) -# -# ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which -# means the whole Japan territory, including later occupations, adopt Japan -# Central Time (UT+9). The adoption began on Oct 1, 1937. -# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT @@ -3109,22 +3221,9 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # [T]he Palestinian cabinet decision (Mar 8th 2016) published on # http://www.palestinecabinet.gov.ps/WebSite/Upload/Decree/GOV_17/16032016134830.pdf # states that summer time will end on Oct 29th at 01:00. -# -# From Tim Parenti (2016-10-19): -# Predict fall transitions on October's last Saturday at 01:00 from now on. -# This is consistent with the 2016 transition as well as our spring -# predictions. -# -# From Paul Eggert (2016-10-19): -# It's also consistent with predictions in the following URLs today: -# https://www.timeanddate.com/time/change/gaza-strip/gaza -# https://www.timeanddate.com/time/change/west-bank/hebron # From Sharef Mustafa (2018-03-16): -# Palestine summer time will start on Mar 24th 2018 by advancing the -# clock by 60 minutes as per Palestinian cabinet decision published on -# the official website, though the decree did not specify the exact -# time of the time shift. +# Palestine summer time will start on Mar 24th 2018 ... # http://www.palestinecabinet.gov.ps/Website/AR/NDecrees/ViewFile.ashx?ID=e7a42ab7-ee23-435a-b9c8-a4f7e81f3817 # From Even Scharning (2019-03-23): @@ -3134,15 +3233,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Sharif Mustafa (2019-03-26): # The Palestinian cabinet announced today that the switch to DST will # be on Fri Mar 29th 2019 by advancing the clock by 60 minutes. -# The decree signing date is Mar 12th but it was not published till today. -# The decree does not specify the exact time of switch. # http://palestinecabinet.gov.ps/Website/AR/NDecrees/ViewFile.ashx?ID=e54e9ea1-50ee-4137-84df-0d6c78da259b # # From Even Scharning (2019-04-10): # Our source in Palestine said it happened Friday 29 at 00:00 local time.... + +# From Sharef Mustafa (2019-10-18): +# Palestine summer time will end on midnight Oct 26th 2019 ... +# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948 # # From Paul Eggert (2019-04-10): # For now, guess spring-ahead transitions are March's last Friday at 00:00. +# +# From Tim Parenti (2016-10-19): +# Predict fall transitions on October's last Saturday at 01:00 from now on. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S diff --git a/make/data/tzdata/backward b/make/data/tzdata/backward index 2a41a98010e..8c12cf74d3f 100644 --- a/make/data/tzdata/backward +++ b/make/data/tzdata/backward @@ -40,6 +40,7 @@ Link America/Atikokan America/Coral_Harbour Link America/Argentina/Cordoba America/Cordoba Link America/Tijuana America/Ensenada Link America/Indiana/Indianapolis America/Fort_Wayne +Link America/Nuuk America/Godthab Link America/Indiana/Indianapolis America/Indianapolis Link America/Argentina/Jujuy America/Jujuy Link America/Indiana/Knox America/Knox_IN diff --git a/make/data/tzdata/europe b/make/data/tzdata/europe index be8a6a03487..8fed2cf5e98 100644 --- a/make/data/tzdata/europe +++ b/make/data/tzdata/europe @@ -572,12 +572,13 @@ Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2 0:00 1:00 IST 1947 Nov 2 2:00s 0:00 - GMT 1948 Apr 18 2:00s 0:00 GB-Eire GMT/IST 1968 Oct 27 -# The next line is for when negative SAVE values are used. +# Vanguard section, for zic and other parsers that support negative DST. 1:00 Eire IST/GMT -# These three lines are for when SAVE values are always nonnegative. +# Rearguard section, for parsers lacking negative DST; see ziguard.awk. # 1:00 - IST 1971 Oct 31 2:00u # 0:00 GB-Eire GMT/IST 1996 # 0:00 EU GMT/IST +# End of rearguard section. ############################################################################### @@ -1041,7 +1042,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 1:00 Czech CE%sT 1946 Dec 1 3:00 # Vanguard section, for zic and other parsers that support negative DST. 1:00 -1:00 GMT 1947 Feb 23 2:00 -# Rearguard section, for parsers that do not support negative DST. +# Rearguard section, for parsers lacking negative DST; see ziguard.awk. # 0:00 - GMT 1947 Feb 23 2:00 # End of rearguard section. 1:00 Czech CE%sT 1979 @@ -1198,14 +1199,17 @@ Zone America/Danmarkshavn -1:14:40 - LMT 1916 Jul 28 -3:00 - -03 1980 Apr 6 2:00 -3:00 EU -03/-02 1996 0:00 - GMT +# +# Use the old name Scoresbysund, as the current name Ittoqqortoormiit +# exceeds tzdb's 14-letter limit and has no common English abbreviation. Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit -2:00 - -02 1980 Apr 6 2:00 -2:00 C-Eur -02/-01 1981 Mar 29 -1:00 EU -01/+00 -Zone America/Godthab -3:26:56 - LMT 1916 Jul 28 # Nuuk +Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb -3:00 - -03 1980 Apr 6 2:00 -3:00 EU -03/-02 -Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base +Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik -4:00 Thule A%sT # Estonia @@ -1575,7 +1579,7 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 Oct # # From January 1st, 1908 the whole of Iceland was standardised at 1 hour # behind GMT. Previously, local mean solar time was used in different parts -# of Iceland, the almanak had been based on Reykjavik mean solar time which +# of Iceland, the almanak had been based on Reykjavík mean solar time which # was 1 hour and 28 minutes behind GMT. # # "first day of winter" referred to [below] means the first day of the 26 weeks diff --git a/make/data/tzdata/leapseconds b/make/data/tzdata/leapseconds index 753cd8e4307..fe8e170ed26 100644 --- a/make/data/tzdata/leapseconds +++ b/make/data/tzdata/leapseconds @@ -87,9 +87,15 @@ Leap 2012 Jun 30 23:59:60 + S Leap 2015 Jun 30 23:59:60 + S Leap 2016 Dec 31 23:59:60 + S +# UTC timestamp when this leap second list expires. +# Any additional leap seconds will come after this. +# This Expires line is commented out for now, +# so that pre-2020a zic implementations do not reject this file. +#Expires 2020 Dec 28 00:00:00 + # POSIX timestamps for the data in this file: #updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1593302400 (2020-06-28 00:00:00 UTC) +#expires 1609113600 (2020-12-28 00:00:00 UTC) -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 diff --git a/make/data/tzdata/northamerica b/make/data/tzdata/northamerica index 0135ef16cd2..60c7addef09 100644 --- a/make/data/tzdata/northamerica +++ b/make/data/tzdata/northamerica @@ -109,7 +109,7 @@ # For more about the first ten years of DST in the United States, see # Robert Garland, Ten years of daylight saving from the Pittsburgh standpoint # (Carnegie Library of Pittsburgh, 1927). -# http://www.clpgh.org/exhibit/dst.html +# https://web.archive.org/web/20160517155308/http://www.clpgh.org/exhibit/dst.html # # Shanks says that DST was called "War Time" in the US in 1918 and 1919. # However, DST was imposed by the Standard Time Act of 1918, which @@ -1493,7 +1493,8 @@ Zone America/Goose_Bay -4:01:40 - LMT 1884 # Happy Valley-Goose Bay -4:00 Canada A%sT -# west Labrador, Nova Scotia, Prince Edward I +# west Labrador, Nova Scotia, Prince Edward I, +# Îles-de-la-Madeleine, Listuguj reserve # From Brian Inglis (2015-07-20): # From the historical weather station records available at: @@ -1512,6 +1513,13 @@ Zone America/Goose_Bay -4:01:40 - LMT 1884 # Happy Valley-Goose Bay # in Canada to observe DST in 1971 but not 1970; for now we'll assume # this is a typo. +# From Jeffery Nichols (2020-01-09): +# America/Halifax ... also applies to Îles-de-la-Madeleine and the Listuguj +# reserve in Quebec. Officially, this came into effect on January 1, 2007 +# (Legal Time Act, CQLR c T-5.1), but the legislative debates surrounding that +# bill say that it is "accommodating the customs and practices" of those +# regions, which suggests that they have always been in-line with Halifax. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Halifax 1916 only - Apr 1 0:00 1:00 D Rule Halifax 1916 only - Oct 1 0:00 0 S @@ -1605,19 +1613,20 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9 # Quebec -# From Paul Eggert (2015-03-24): +# From Paul Eggert (2020-01-10): # See America/Toronto for most of Quebec, including Montreal. +# See America/Halifax for the Îles de la Madeleine and the Listuguj reserve. # # Matthews and Vincent (1998) also write that Quebec east of the -63 # meridian is supposed to observe AST, but residents as far east as # Natashquan use EST/EDT, and residents east of Natashquan use AST. # The Quebec department of justice writes in # "The situation in Minganie and Basse-Côte-Nord" -# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm +# https://www.justice.gouv.qc.ca/en/department/ministre/functions-and-responsabilities/legal-time-in-quebec/the-situation-in-minganie-and-basse-cote-nord/ # that the coastal strip from just east of Natashquan to Blanc-Sablon # observes Atlantic standard time all year round. -# https://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en -# says this common practice was codified into law as of 2007. +# This common practice was codified into law as of 2007; see Legal Time Act, +# CQLR c T-5.1 . # For lack of better info, guess this practice began around 1970, contra to # Shanks & Pottenger who have this region observing AST/ADT. @@ -1636,6 +1645,15 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884 # Nipigon (EST) and Rainy River (CST) are the largest that we know of. # Far west Ontario is like Winnipeg; far east Quebec is like Halifax. +# From Jeffery Nichols (2020-02-06): +# According to the [Shanks] atlas, those western Ontario zones are huge, +# covering most of Ontario northwest of Sault Ste Marie and Timmins. +# The zones seem to include towns bigger than the ones they're named after, +# like Dryden in America/Rainy_River and Wawa (and maybe Attawapiskat) in +# America/Nipigon. I assume it's too much trouble to change the name of the +# zone (like when you found out that America/Glace_Bay includes Sydney, Nova +# Scotia).... + # From Mark Brader (2003-07-26): # [According to the Toronto Star] Orillia, Ontario, adopted DST # effective Saturday, 1912-06-22, 22:00; the article mentions that @@ -2442,6 +2460,18 @@ Zone America/Creston -7:46:04 - LMT 1884 # obtained in November 2008 should be ignored... # I apologize for reporting incorrect information in 2008. +# From Tim Parenti (2020-03-05): +# The government of Yukon announced [yesterday] the cessation of seasonal time +# changes. "After clocks are pushed ahead one hour on March 8, the territory +# will remain on [UTC-07]. ... [The government] found 93 per cent of +# respondents wanted to end seasonal time changes and, of that group, 70 per +# cent wanted 'permanent Pacific Daylight Saving Time.'" +# https://www.cbc.ca/news/canada/north/yukon-end-daylight-saving-time-1.5486358 +# +# Although the government press release prefers PDT, we prefer MST for +# consistency with nearby Dawson Creek, Creston, and Fort Nelson. +# https://yukon.ca/en/news/yukon-end-seasonal-time-change + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule NT_YK 1918 only - Apr 14 2:00 1:00 D Rule NT_YK 1918 only - Oct 27 2:00 0 S @@ -2496,11 +2526,13 @@ Zone America/Inuvik 0 - -00 1953 # Inuvik founded Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20 -9:00 NT_YK Y%sT 1967 May 28 0:00 -8:00 NT_YK P%sT 1980 - -8:00 Canada P%sT + -8:00 Canada P%sT 2020 Mar 8 2:00 + -7:00 - MST Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 -9:00 NT_YK Y%sT 1973 Oct 28 0:00 -8:00 NT_YK P%sT 1980 - -8:00 Canada P%sT + -8:00 Canada P%sT 2020 Mar 8 2:00 + -7:00 - MST ############################################################################### diff --git a/make/data/tzdata/zone.tab b/make/data/tzdata/zone.tab index 8020ca04251..e33057e45ce 100644 --- a/make/data/tzdata/zone.tab +++ b/make/data/tzdata/zone.tab @@ -154,8 +154,8 @@ CA +4906-11631 America/Creston MST - BC (Creston) CA +5946-12014 America/Dawson_Creek MST - BC (Dawson Cr, Ft St John) CA +5848-12242 America/Fort_Nelson MST - BC (Ft Nelson) CA +4916-12307 America/Vancouver Pacific - BC (most areas) -CA +6043-13503 America/Whitehorse Pacific - Yukon (south) -CA +6404-13925 America/Dawson Pacific - Yukon (north) +CA +6043-13503 America/Whitehorse Pacific - Yukon (east) +CA +6404-13925 America/Dawson Pacific - Yukon (west) CC -1210+09655 Indian/Cocos CD -0418+01518 Africa/Kinshasa Dem. Rep. of Congo (west) CD -1140+02728 Africa/Lubumbashi Dem. Rep. of Congo (east) @@ -212,7 +212,7 @@ GF +0456-05220 America/Cayenne GG +492717-0023210 Europe/Guernsey GH +0533-00013 Africa/Accra GI +3608-00521 Europe/Gibraltar -GL +6411-05144 America/Godthab Greenland (most areas) +GL +6411-05144 America/Nuuk Greenland (most areas) GL +7646-01840 America/Danmarkshavn National Park (east coast) GL +7029-02158 America/Scoresbysund Scoresbysund/Ittoqqortoormiit GL +7634-06847 America/Thule Thule/Pituffik @@ -358,7 +358,7 @@ RU +554521+0373704 Europe/Moscow MSK+00 - Moscow area # The obsolescent zone.tab format cannot represent Europe/Simferopol well. # Put it in RU section and list as UA. See "territorial claims" above. # Programs should use zone1970.tab instead; see above. -UA +4457+03406 Europe/Simferopol MSK+00 - Crimea +UA +4457+03406 Europe/Simferopol Crimea RU +5836+04939 Europe/Kirov MSK+00 - Kirov RU +4621+04803 Europe/Astrakhan MSK+01 - Astrakhan RU +4844+04425 Europe/Volgograd MSK+01 - Volgograd @@ -422,8 +422,8 @@ TV -0831+17913 Pacific/Funafuti TW +2503+12130 Asia/Taipei TZ -0648+03917 Africa/Dar_es_Salaam UA +5026+03031 Europe/Kiev Ukraine (most areas) -UA +4837+02218 Europe/Uzhgorod Ruthenia -UA +4750+03510 Europe/Zaporozhye Zaporozh'ye/Zaporizhia; Lugansk/Luhansk (east) +UA +4837+02218 Europe/Uzhgorod Transcarpathia +UA +4750+03510 Europe/Zaporozhye Zaporozhye and east Lugansk UG +0019+03225 Africa/Kampala UM +2813-17722 Pacific/Midway Midway Islands UM +1917+16637 Pacific/Wake Wake Island diff --git a/make/hotspot/gensrc/GensrcJfr.gmk b/make/hotspot/gensrc/GensrcJfr.gmk index 8cd879f32dc..9271de82b72 100644 --- a/make/hotspot/gensrc/GensrcJfr.gmk +++ b/make/hotspot/gensrc/GensrcJfr.gmk @@ -29,16 +29,9 @@ JFR_TOOLS_SRCDIR := $(TOPDIR)/make/src/classes JFR_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/buildtools/tools_classes -$(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \ - JAVAC := $(JAVAC), \ - FLAGS := -Xlint:all -Werror, \ - SERVER_DIR := $(SJAVAC_SERVER_DIR), \ - SERVER_JVM := $(SJAVAC_SERVER_JAVA), \ - DISABLE_SJAVAC := true, \ -)) - $(eval $(call SetupJavaCompilation, BUILD_JFR_TOOLS, \ - SETUP := GENERATE_JFRBYTECODE, \ + COMPILER := bootjdk, \ + SMALL_JAVA := false, \ SRC := $(JFR_TOOLS_SRCDIR), \ BIN := $(JFR_TOOLS_OUTPUTDIR), \ DISABLED_WARNINGS := try, \ diff --git a/make/hotspot/gensrc/GensrcJvmti.gmk b/make/hotspot/gensrc/GensrcJvmti.gmk index 3a910360114..fe9af4e19b7 100644 --- a/make/hotspot/gensrc/GensrcJvmti.gmk +++ b/make/hotspot/gensrc/GensrcJvmti.gmk @@ -32,16 +32,9 @@ $(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJvmti.gmk)) JVMTI_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/prims JVMTI_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jvmti -$(eval $(call SetupJavaCompiler, GENERATE_OLDBYTECODE, \ - JAVAC := $(JAVAC), \ - FLAGS := -Xlint:all -Werror, \ - SERVER_DIR := $(SJAVAC_SERVER_DIR), \ - SERVER_JVM := $(SJAVAC_SERVER_JAVA), \ - DISABLE_SJAVAC := true, \ -)) - $(eval $(call SetupJavaCompilation, BUILD_JVMTI_TOOLS, \ - SETUP := GENERATE_OLDBYTECODE, \ + COMPILER := bootjdk, \ + SMALL_JAVA := false, \ SRC := $(JVMTI_TOOLS_SRCDIR), \ DISABLED_WARNINGS := rawtypes cast, \ INCLUDE_FILES := jvmtiGen.java jvmtiEnvFill.java, \ diff --git a/make/hotspot/ide/CreateVSProject.gmk b/make/hotspot/ide/CreateVSProject.gmk index a524ce33edb..d001499d408 100644 --- a/make/hotspot/ide/CreateVSProject.gmk +++ b/make/hotspot/ide/CreateVSProject.gmk @@ -29,7 +29,6 @@ default: all include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk include Execute.gmk ifeq ($(call isTargetOs, windows), true) @@ -97,10 +96,11 @@ ifeq ($(call isTargetOs, windows), true) TOOLS_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR)/support/tools_classes $(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \ - SETUP := GENERATE_OLDBYTECODE, \ - DISABLED_WARNINGS := auxiliaryclass deprecation rawtypes unchecked cast, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ + DISABLED_WARNINGS := auxiliaryclass deprecation rawtypes unchecked cast options, \ SRC := $(TOPDIR)/make/hotspot/src/classes, \ BIN := $(TOOLS_OUTPUTDIR), \ + JAVAC_FLAGS := -XDstringConcat=inline, \ )) TARGETS += $(BUILD_PROJECT_CREATOR) diff --git a/make/hotspot/lib/JvmFeatures.gmk b/make/hotspot/lib/JvmFeatures.gmk index 5f5e8c02342..22772493f23 100644 --- a/make/hotspot/lib/JvmFeatures.gmk +++ b/make/hotspot/lib/JvmFeatures.gmk @@ -55,6 +55,10 @@ ifeq ($(call check-jvm-feature, zero), true) endif endif +ifeq ($(JVM_VARIANT), custom) + JVM_CFLAGS_FEATURES += -DVMTYPE=\"Custom\" +endif + ifeq ($(call check-jvm-feature, minimal), true) JVM_CFLAGS_FEATURES += -DMINIMAL_JVM -DVMTYPE=\"Minimal\" ifeq ($(call isTargetOs, linux), true) @@ -151,8 +155,6 @@ endif ifneq ($(call check-jvm-feature, serialgc), true) JVM_CFLAGS_FEATURES += -DINCLUDE_SERIALGC=0 JVM_EXCLUDE_PATTERNS += gc/serial - # If serial is disabled, we cannot use serial as OldGC in parallel - JVM_EXCLUDE_FILES += psMarkSweep.cpp psMarkSweepDecorator.cpp endif ifneq ($(call check-jvm-feature, epsilongc), true) diff --git a/make/idea/build.xml b/make/idea/build.xml index 611ba851447..0292f0f5d35 100644 --- a/make/idea/build.xml +++ b/make/idea/build.xml @@ -1,10 +1,9 @@ - + + + diff --git a/make/idea/template/src/idea/IdeaLoggerWrapper.java b/make/idea/template/src/idea/IdeaLoggerWrapper.java new file mode 100644 index 00000000000..0071669815a --- /dev/null +++ b/make/idea/template/src/idea/IdeaLoggerWrapper.java @@ -0,0 +1,13 @@ +package idea; + +import org.apache.tools.ant.Task; + +/** + * This class implements a custom Ant task which replaces the standard Intellij IDEA Ant logger + * with a custom one which generates tighter output. + */ +public class IdeaLoggerWrapper extends Task { + public void execute() { + new JdkIdeaAntLogger(getProject()); + } +} diff --git a/make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java b/make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java index 46b9357b4eb..432cd654eb3 100644 --- a/make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java +++ b/make/jdk/src/classes/build/tools/generatecharacter/GenerateCharacter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -700,7 +700,7 @@ static void generateCharacterClass(String theTemplateFileName, PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(theOutputFileName))); out.println(commentStart + " This file was generated AUTOMATICALLY from a template file " + - new java.util.Date() + commentEnd); + commentEnd); int marklen = commandMarker.length(); LOOP: while(true) { try { diff --git a/make/jdk/src/classes/build/tools/jigsaw/AddPackagesAttribute.java b/make/jdk/src/classes/build/tools/jigsaw/AddPackagesAttribute.java index 7aa02f365b9..4ed08c36446 100644 --- a/make/jdk/src/classes/build/tools/jigsaw/AddPackagesAttribute.java +++ b/make/jdk/src/classes/build/tools/jigsaw/AddPackagesAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Arrays; import java.util.Optional; import java.util.Set; @@ -83,7 +84,10 @@ static void addPackagesAttribute(Path mi, Set packages) throws IOExcepti bytes = baos.toByteArray(); } - Files.write(mi, bytes); + byte[] currentBytes = Files.readAllBytes(mi); + if (!Arrays.equals(bytes, currentBytes)) { + Files.write(mi, bytes); + } } } diff --git a/make/langtools/build.xml b/make/langtools/build.xml index 8ae4efaeeff..84db47e0edb 100644 --- a/make/langtools/build.xml +++ b/make/langtools/build.xml @@ -88,21 +88,11 @@ - - fs = project.getProperty("file.separator"); - path = project.getProperty("build.modules"); - mod = source.substr(source.lastIndexOf(fs)+1); - self.addMappedName(mod + "=\"" + path + fs + mod + "\""); - + - - fs = project.getProperty("file.separator"); - path = project.getProperty("build.modules"); - mod = source.substr(source.lastIndexOf(fs)+1); - self.addMappedName(mod + "=" + path + fs + mod); - + @@ -212,14 +202,7 @@ - - fs = project.getProperty("file.separator"); - path_src = project.getProperty("src.dir"); - path_sep = project.getProperty("path.separator"); - path_gensrc = project.getProperty("build.gensrc"); - mod = source.substr(source.lastIndexOf(fs)+1); - self.addMappedName(mod + "=" + path_src + fs + mod + path_sep + path_gensrc + fs + mod); - + diff --git a/make/langtools/intellij/build.xml b/make/langtools/intellij/build.xml index f08f9d9e5fa..8f08492afc0 100644 --- a/make/langtools/intellij/build.xml +++ b/make/langtools/intellij/build.xml @@ -1,10 +1,9 @@ - + + + diff --git a/make/langtools/intellij/template/src/idea/IdeaLoggerWrapper.java b/make/langtools/intellij/template/src/idea/IdeaLoggerWrapper.java new file mode 100644 index 00000000000..c5a5015be20 --- /dev/null +++ b/make/langtools/intellij/template/src/idea/IdeaLoggerWrapper.java @@ -0,0 +1,13 @@ +package idea; + +import org.apache.tools.ant.Task; + +/** + * This class implements a custom Ant task which replaces the standard Intellij IDEA Ant logger + * with a custom one which generates tighter output. + */ +public class IdeaLoggerWrapper extends Task { + public void execute() { + new LangtoolsIdeaAntLogger(getProject()); + } +} diff --git a/make/launcher/Launcher-jdk.jstatd.gmk b/make/launcher/Launcher-jdk.jstatd.gmk deleted file mode 100644 index e9286d63094..00000000000 --- a/make/launcher/Launcher-jdk.jstatd.gmk +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -include LauncherCommon.gmk - -$(eval $(call SetupBuildLauncher, jstatd, \ - MAIN_CLASS := sun.tools.jstatd.Jstatd, \ -)) - -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, launcher/Launcher-jdk.jstatd-post.gmk)) diff --git a/make/copy/Copy-java.base.gmk b/make/modules/java.base/Copy.gmk similarity index 97% rename from make/copy/Copy-java.base.gmk rename to make/modules/java.base/Copy.gmk index 7e262a39389..c2251fa18af 100644 --- a/make/copy/Copy-java.base.gmk +++ b/make/modules/java.base/Copy.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,8 @@ include CopyCommon.gmk include Modules.gmk include TextFileProcessing.gmk -$(eval $(call IncludeCustomExtension, copy/Copy-java.base.gmk)) +# Hook to include the corresponding custom file, if present. +$(eval $(call IncludeCustomExtension, modules/java.base/Copy.gmk)) ################################################################################ diff --git a/make/gendata/Gendata-java.base.gmk b/make/modules/java.base/Gendata.gmk similarity index 90% rename from make/gendata/Gendata-java.base.gmk rename to make/modules/java.base/Gendata.gmk index 9e4580e9c89..6ca9c6dee32 100644 --- a/make/gendata/Gendata-java.base.gmk +++ b/make/modules/java.base/Gendata.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,18 +25,15 @@ include GendataCommon.gmk -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, gendata/Gendata-java.base.gmk)) +include gendata/GendataBreakIterator.gmk -include GendataBreakIterator.gmk +include gendata/GendataTZDB.gmk -include GendataTZDB.gmk +include gendata/GendataBlacklistedCerts.gmk -include GendataBlacklistedCerts.gmk +include gendata/GendataCryptoPolicy.gmk -include GendataCryptoPolicy.gmk - -include GendataPublicSuffixList.gmk +include gendata/GendataPublicSuffixList.gmk ################################################################################ diff --git a/make/gensrc/Gensrc-java.base.gmk b/make/modules/java.base/Gensrc.gmk similarity index 90% rename from make/gensrc/Gensrc-java.base.gmk rename to make/modules/java.base/Gensrc.gmk index 81d37181e38..7b54a6980ae 100644 --- a/make/gensrc/Gensrc-java.base.gmk +++ b/make/modules/java.base/Gensrc.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,16 +25,16 @@ include GensrcCommonJdk.gmk -include GensrcLocaleData.gmk -include GensrcCharacterData.gmk -include GensrcMisc.gmk -include GensrcCharsetMapping.gmk -include GensrcCharsetCoder.gmk -include GensrcBuffer.gmk -include GensrcExceptions.gmk -include GensrcVarHandles.gmk -include GensrcModuleLoaderMap.gmk -include GensrcEmojiData.gmk +include gensrc/GensrcLocaleData.gmk +include gensrc/GensrcCharacterData.gmk +include gensrc/GensrcMisc.gmk +include gensrc/GensrcCharsetMapping.gmk +include gensrc/GensrcCharsetCoder.gmk +include gensrc/GensrcBuffer.gmk +include gensrc/GensrcExceptions.gmk +include gensrc/GensrcVarHandles.gmk +include gensrc/GensrcModuleLoaderMap.gmk +include gensrc/GensrcEmojiData.gmk ################################################################################ diff --git a/make/launcher/Launcher-java.base.gmk b/make/modules/java.base/Launcher.gmk similarity index 96% rename from make/launcher/Launcher-java.base.gmk rename to make/modules/java.base/Launcher.gmk index cc5fb458312..92b668788b4 100644 --- a/make/launcher/Launcher-java.base.gmk +++ b/make/modules/java.base/Launcher.gmk @@ -25,7 +25,8 @@ include LauncherCommon.gmk -$(eval $(call IncludeCustomExtension, launcher/Launcher-java.base.gmk)) +# Hook to include the corresponding custom file, if present. +$(eval $(call IncludeCustomExtension, modules/java.base/Launcher.gmk)) JAVA_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/launcher/java.rc diff --git a/make/lib/Lib-java.base.gmk b/make/modules/java.base/Lib.gmk similarity index 98% rename from make/lib/Lib-java.base.gmk rename to make/modules/java.base/Lib.gmk index f128e3bc80a..9f33e2340b8 100644 --- a/make/lib/Lib-java.base.gmk +++ b/make/modules/java.base/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ include LibCommon.gmk # Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk)) +$(eval $(call IncludeCustomExtension, modules/java.base/Lib.gmk)) # Prepare the find cache. $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native)) @@ -34,7 +34,7 @@ $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native)) ################################################################################ # Create all the core libraries -include CoreLibraries.gmk +include lib/CoreLibraries.gmk ################################################################################ # Create the network library diff --git a/make/gendata/GendataBlacklistedCerts.gmk b/make/modules/java.base/gendata/GendataBlacklistedCerts.gmk similarity index 91% rename from make/gendata/GendataBlacklistedCerts.gmk rename to make/modules/java.base/gendata/GendataBlacklistedCerts.gmk index 9ebf13ce885..d5a5d0b61ff 100644 --- a/make/gendata/GendataBlacklistedCerts.gmk +++ b/make/modules/java.base/gendata/GendataBlacklistedCerts.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,6 @@ # questions. # -$(eval $(call IncludeCustomExtension, gendata/GendataBlacklistedCerts.gmk)) - GENDATA_BLACKLISTED_CERTS_SRC += $(TOPDIR)/make/data/blacklistedcertsconverter/blacklisted.certs.pem GENDATA_BLACKLISTED_CERTS := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/security/blacklisted.certs diff --git a/make/gendata/GendataBreakIterator.gmk b/make/modules/java.base/gendata/GendataBreakIterator.gmk similarity index 89% rename from make/gendata/GendataBreakIterator.gmk rename to make/modules/java.base/gendata/GendataBreakIterator.gmk index 99cc7e3b277..d314253b4fe 100644 --- a/make/gendata/GendataBreakIterator.gmk +++ b/make/modules/java.base/gendata/GendataBreakIterator.gmk @@ -1,5 +1,5 @@ -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,21 +44,25 @@ TEXT_SOURCES := $(TEXT_PKG)/BreakIteratorRules.java \ BREAK_ITERATOR_CLASSES := $(BUILDTOOLS_OUTPUTDIR)/break_iterator_classes # These two files should be moved out to a build tool! -$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR_BASE, \ - SETUP := GENERATE_OLDBYTECODE, \ +$(eval $(call SetupJavaCompilation, BUILD_BREAKITERATOR_BASE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := $(TOPDIR)/src/java.base/share/classes, \ INCLUDE_FILES := \ $(TEXT_PKG)/BreakIteratorRules.java \ $(TEXT_PKG)/BreakIteratorInfo.java, \ - BIN := $(BREAK_ITERATOR_CLASSES)/java.base)) + BIN := $(BREAK_ITERATOR_CLASSES)/java.base, \ + DISABLED_WARNINGS := options, \ +)) -$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR_LD, \ - SETUP := GENERATE_OLDBYTECODE, \ +$(eval $(call SetupJavaCompilation, BUILD_BREAKITERATOR_LD, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := $(TOPDIR)/src/jdk.localedata/share/classes, \ INCLUDE_FILES := \ $(TEXT_PKG_LD)/BreakIteratorRules_th.java \ $(TEXT_PKG_LD)/BreakIteratorInfo_th.java, \ - BIN := $(BREAK_ITERATOR_CLASSES)/jdk.localedata)) + BIN := $(BREAK_ITERATOR_CLASSES)/jdk.localedata, \ + DISABLED_WARNINGS := options, \ +)) BREAK_ITERATOR_BOOTCLASSPATH := \ --patch-module java.base=$(BREAK_ITERATOR_CLASSES)/java.base \ diff --git a/make/gendata/GendataCryptoPolicy.gmk b/make/modules/java.base/gendata/GendataCryptoPolicy.gmk similarity index 100% rename from make/gendata/GendataCryptoPolicy.gmk rename to make/modules/java.base/gendata/GendataCryptoPolicy.gmk diff --git a/make/gendata/GendataPublicSuffixList.gmk b/make/modules/java.base/gendata/GendataPublicSuffixList.gmk similarity index 100% rename from make/gendata/GendataPublicSuffixList.gmk rename to make/modules/java.base/gendata/GendataPublicSuffixList.gmk diff --git a/make/gendata/GendataTZDB.gmk b/make/modules/java.base/gendata/GendataTZDB.gmk similarity index 100% rename from make/gendata/GendataTZDB.gmk rename to make/modules/java.base/gendata/GendataTZDB.gmk diff --git a/make/gensrc/GensrcBuffer.gmk b/make/modules/java.base/gensrc/GensrcBuffer.gmk similarity index 100% rename from make/gensrc/GensrcBuffer.gmk rename to make/modules/java.base/gensrc/GensrcBuffer.gmk diff --git a/make/gensrc/GensrcCharacterData.gmk b/make/modules/java.base/gensrc/GensrcCharacterData.gmk similarity index 100% rename from make/gensrc/GensrcCharacterData.gmk rename to make/modules/java.base/gensrc/GensrcCharacterData.gmk diff --git a/make/gensrc/GensrcCharsetCoder.gmk b/make/modules/java.base/gensrc/GensrcCharsetCoder.gmk similarity index 100% rename from make/gensrc/GensrcCharsetCoder.gmk rename to make/modules/java.base/gensrc/GensrcCharsetCoder.gmk diff --git a/make/gensrc/GensrcCharsetMapping.gmk b/make/modules/java.base/gensrc/GensrcCharsetMapping.gmk similarity index 100% rename from make/gensrc/GensrcCharsetMapping.gmk rename to make/modules/java.base/gensrc/GensrcCharsetMapping.gmk diff --git a/make/gensrc/GensrcEmojiData.gmk b/make/modules/java.base/gensrc/GensrcEmojiData.gmk similarity index 100% rename from make/gensrc/GensrcEmojiData.gmk rename to make/modules/java.base/gensrc/GensrcEmojiData.gmk diff --git a/make/gensrc/GensrcExceptions.gmk b/make/modules/java.base/gensrc/GensrcExceptions.gmk similarity index 100% rename from make/gensrc/GensrcExceptions.gmk rename to make/modules/java.base/gensrc/GensrcExceptions.gmk diff --git a/make/gensrc/GensrcLocaleData.gmk b/make/modules/java.base/gensrc/GensrcLocaleData.gmk similarity index 100% rename from make/gensrc/GensrcLocaleData.gmk rename to make/modules/java.base/gensrc/GensrcLocaleData.gmk diff --git a/make/gensrc/GensrcMisc.gmk b/make/modules/java.base/gensrc/GensrcMisc.gmk similarity index 100% rename from make/gensrc/GensrcMisc.gmk rename to make/modules/java.base/gensrc/GensrcMisc.gmk diff --git a/make/gensrc/GensrcModuleLoaderMap.gmk b/make/modules/java.base/gensrc/GensrcModuleLoaderMap.gmk similarity index 100% rename from make/gensrc/GensrcModuleLoaderMap.gmk rename to make/modules/java.base/gensrc/GensrcModuleLoaderMap.gmk diff --git a/make/gensrc/GensrcVarHandles.gmk b/make/modules/java.base/gensrc/GensrcVarHandles.gmk similarity index 97% rename from make/gensrc/GensrcVarHandles.gmk rename to make/modules/java.base/gensrc/GensrcVarHandles.gmk index b66fd43c98f..c82e59e1eed 100644 --- a/make/gensrc/GensrcVarHandles.gmk +++ b/make/modules/java.base/gensrc/GensrcVarHandles.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -277,6 +277,3 @@ $(foreach t, $(VARHANDLES_MEMORY_ADDRESS_TYPES), \ $(eval $(call GenerateVarHandleMemoryAccess,VAR_HANDLE_MEMORY_ADDRESS_$t,$t))) GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES) - -# Include custom extension post hook -$(eval $(call IncludeCustomExtension, gensrc/GensrcVarHandles-post.gmk)) diff --git a/make/lib/CoreLibraries.gmk b/make/modules/java.base/lib/CoreLibraries.gmk similarity index 97% rename from make/lib/CoreLibraries.gmk rename to make/modules/java.base/lib/CoreLibraries.gmk index 2c789f65b8e..ab8a75cf454 100644 --- a/make/lib/CoreLibraries.gmk +++ b/make/modules/java.base/lib/CoreLibraries.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,10 +23,6 @@ # questions. # -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, lib/CoreLibraries.gmk)) - - ########################################################################################## # libfdlibm is statically linked with libjava below and not delivered into the # product on its own. diff --git a/make/copy/Copy-java.desktop.gmk b/make/modules/java.desktop/Copy.gmk similarity index 95% rename from make/copy/Copy-java.desktop.gmk rename to make/modules/java.desktop/Copy.gmk index cfe209e581a..fe59c21cfb1 100644 --- a/make/copy/Copy-java.desktop.gmk +++ b/make/modules/java.desktop/Copy.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,8 +26,6 @@ include CopyCommon.gmk include Modules.gmk -$(eval $(call IncludeCustomExtension, copy/Copy-java.desktop.gmk)) - ################################################################################ $(CONF_DST_DIR)/sound.properties: $(TOPDIR)/src/java.desktop/share/conf/sound.properties diff --git a/make/gendata/Gendata-java.desktop.gmk b/make/modules/java.desktop/Gendata.gmk similarity index 89% rename from make/gendata/Gendata-java.desktop.gmk rename to make/modules/java.desktop/Gendata.gmk index 73dbec0d873..a3f0c926ca6 100644 --- a/make/gendata/Gendata-java.desktop.gmk +++ b/make/modules/java.desktop/Gendata.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,6 @@ include GendataCommon.gmk -include GendataFontConfig.gmk +include gendata/GendataFontConfig.gmk -include GendataHtml32dtd.gmk +include gendata/GendataHtml32dtd.gmk diff --git a/make/gensrc/Gensrc-java.desktop.gmk b/make/modules/java.desktop/Gensrc.gmk similarity index 92% rename from make/gensrc/Gensrc-java.desktop.gmk rename to make/modules/java.desktop/Gensrc.gmk index c41ef00aa08..c32107a529f 100644 --- a/make/gensrc/Gensrc-java.desktop.gmk +++ b/make/modules/java.desktop/Gensrc.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,17 +26,17 @@ include GensrcCommonJdk.gmk # Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, gensrc/Gensrc-java.desktop.gmk)) +$(eval $(call IncludeCustomExtension, modules/java.desktop/Gensrc.gmk)) ifeq ($(call isTargetOs, windows), false) - include GensrcIcons.gmk + include gensrc/GensrcIcons.gmk endif ifeq ($(call isTargetOs, linux solaris aix), true) - include GensrcX11Wrappers.gmk + include gensrc/GensrcX11Wrappers.gmk endif -include GensrcSwing.gmk +include gensrc/GensrcSwing.gmk ################################################################################ diff --git a/make/lib/Lib-java.desktop.gmk b/make/modules/java.desktop/Lib.gmk similarity index 96% rename from make/lib/Lib-java.desktop.gmk rename to make/modules/java.desktop/Lib.gmk index 6171b6566ce..c72cbdb9929 100644 --- a/make/lib/Lib-java.desktop.gmk +++ b/make/modules/java.desktop/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ include LibCommon.gmk # Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, lib/Lib-java.desktop.gmk)) +$(eval $(call IncludeCustomExtension, modules/java.desktop/Lib.gmk)) # Prepare the find cache. $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native)) @@ -34,7 +34,7 @@ $(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native)) ################################################################################ # Create the AWT/2D libraries -include Awt2dLibraries.gmk +include lib/Awt2dLibraries.gmk ################################################################################ # Create the libjsound library diff --git a/make/gendata/GendataFontConfig.gmk b/make/modules/java.desktop/gendata/GendataFontConfig.gmk similarity index 100% rename from make/gendata/GendataFontConfig.gmk rename to make/modules/java.desktop/gendata/GendataFontConfig.gmk diff --git a/make/gendata/GendataHtml32dtd.gmk b/make/modules/java.desktop/gendata/GendataHtml32dtd.gmk similarity index 100% rename from make/gendata/GendataHtml32dtd.gmk rename to make/modules/java.desktop/gendata/GendataHtml32dtd.gmk diff --git a/make/gensrc/GensrcIcons.gmk b/make/modules/java.desktop/gensrc/GensrcIcons.gmk similarity index 97% rename from make/gensrc/GensrcIcons.gmk rename to make/modules/java.desktop/gensrc/GensrcIcons.gmk index 53a406c2357..8757030166e 100644 --- a/make/gensrc/GensrcIcons.gmk +++ b/make/modules/java.desktop/gensrc/GensrcIcons.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,6 @@ # questions. # -$(eval $(call IncludeCustomExtension, gensrc/GensrcIcons.gmk)) - GENSRC_AWT_ICONS := GENSRC_AWT_ICONS_SRC := GENSRC_AWT_ICONS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop diff --git a/make/gensrc/GensrcSwing.gmk b/make/modules/java.desktop/gensrc/GensrcSwing.gmk similarity index 100% rename from make/gensrc/GensrcSwing.gmk rename to make/modules/java.desktop/gensrc/GensrcSwing.gmk diff --git a/make/gensrc/GensrcX11Wrappers.gmk b/make/modules/java.desktop/gensrc/GensrcX11Wrappers.gmk similarity index 100% rename from make/gensrc/GensrcX11Wrappers.gmk rename to make/modules/java.desktop/gensrc/GensrcX11Wrappers.gmk diff --git a/make/lib/Awt2dLibraries.gmk b/make/modules/java.desktop/lib/Awt2dLibraries.gmk similarity index 98% rename from make/lib/Awt2dLibraries.gmk rename to make/modules/java.desktop/lib/Awt2dLibraries.gmk index 7f2eeae1d9c..0c0dee57275 100644 --- a/make/lib/Awt2dLibraries.gmk +++ b/make/modules/java.desktop/lib/Awt2dLibraries.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,6 @@ # questions. # -$(eval $(call IncludeCustomExtension, lib/Awt2dLibraries-pre.gmk)) - WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib LIBAWT_DEFAULT_HEADER_DIRS := \ @@ -900,8 +898,3 @@ ifeq ($(call isTargetOs, macosx), true) $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT) endif - -################################################################################ - -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, lib/Awt2dLibraries.gmk)) diff --git a/make/lib/Lib-java.instrument.gmk b/make/modules/java.instrument/Lib.gmk similarity index 93% rename from make/lib/Lib-java.instrument.gmk rename to make/modules/java.instrument/Lib.gmk index dfb1b63bb73..6a28ba9dbfb 100644 --- a/make/lib/Lib-java.instrument.gmk +++ b/make/modules/java.instrument/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,6 @@ include LibCommon.gmk -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, lib/Lib-java.instrument.gmk)) - ################################################################################ ifeq ($(call isTargetOs, windows), true) diff --git a/make/copy/Copy-java.logging.gmk b/make/modules/java.logging/Copy.gmk similarity index 100% rename from make/copy/Copy-java.logging.gmk rename to make/modules/java.logging/Copy.gmk diff --git a/make/gensrc/Gensrc-java.logging.gmk b/make/modules/java.logging/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-java.logging.gmk rename to make/modules/java.logging/Gensrc.gmk diff --git a/make/lib/Lib-java.management.gmk b/make/modules/java.management/Lib.gmk similarity index 83% rename from make/lib/Lib-java.management.gmk rename to make/modules/java.management/Lib.gmk index 92475323056..1817d266476 100644 --- a/make/lib/Lib-java.management.gmk +++ b/make/modules/java.management/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,6 @@ include LibCommon.gmk -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, lib/Lib-java.management.gmk)) - ################################################################################ LIBMANAGEMENT_OPTIMIZATION := HIGH @@ -52,8 +49,3 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \ $(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBMANAGEMENT) - -################################################################################ - -# Include custom extension post hook -$(eval $(call IncludeCustomExtension, lib/Lib-java.management-post.gmk)) diff --git a/make/lib/Lib-java.prefs.gmk b/make/modules/java.prefs/Lib.gmk similarity index 100% rename from make/lib/Lib-java.prefs.gmk rename to make/modules/java.prefs/Lib.gmk diff --git a/make/launcher/Launcher-java.rmi.gmk b/make/modules/java.rmi/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-java.rmi.gmk rename to make/modules/java.rmi/Launcher.gmk diff --git a/make/lib/Lib-java.rmi.gmk b/make/modules/java.rmi/Lib.gmk similarity index 100% rename from make/lib/Lib-java.rmi.gmk rename to make/modules/java.rmi/Lib.gmk diff --git a/make/launcher/Launcher-java.scripting.gmk b/make/modules/java.scripting/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-java.scripting.gmk rename to make/modules/java.scripting/Launcher.gmk diff --git a/make/launcher/Launcher-java.security.jgss.gmk b/make/modules/java.security.jgss/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-java.security.jgss.gmk rename to make/modules/java.security.jgss/Launcher.gmk diff --git a/make/lib/Lib-java.security.jgss.gmk b/make/modules/java.security.jgss/Lib.gmk similarity index 100% rename from make/lib/Lib-java.security.jgss.gmk rename to make/modules/java.security.jgss/Lib.gmk diff --git a/make/lib/Lib-java.smartcardio.gmk b/make/modules/java.smartcardio/Lib.gmk similarity index 100% rename from make/lib/Lib-java.smartcardio.gmk rename to make/modules/java.smartcardio/Lib.gmk diff --git a/make/copy/Copy-jdk.accessibility.gmk b/make/modules/jdk.accessibility/Copy.gmk similarity index 100% rename from make/copy/Copy-jdk.accessibility.gmk rename to make/modules/jdk.accessibility/Copy.gmk diff --git a/make/launcher/Launcher-jdk.accessibility.gmk b/make/modules/jdk.accessibility/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.accessibility.gmk rename to make/modules/jdk.accessibility/Launcher.gmk diff --git a/make/lib/Lib-jdk.accessibility.gmk b/make/modules/jdk.accessibility/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.accessibility.gmk rename to make/modules/jdk.accessibility/Lib.gmk diff --git a/make/launcher/Launcher-jdk.aot.gmk b/make/modules/jdk.aot/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.aot.gmk rename to make/modules/jdk.aot/Launcher.gmk diff --git a/make/lib/Lib-jdk.attach.gmk b/make/modules/jdk.attach/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.attach.gmk rename to make/modules/jdk.attach/Lib.gmk diff --git a/make/gensrc/Gensrc-jdk.charsets.gmk b/make/modules/jdk.charsets/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.charsets.gmk rename to make/modules/jdk.charsets/Gensrc.gmk diff --git a/make/gendata/Gendata-jdk.compiler.gmk b/make/modules/jdk.compiler/Gendata.gmk similarity index 93% rename from make/gendata/Gendata-jdk.compiler.gmk rename to make/modules/jdk.compiler/Gendata.gmk index eb08bdc421c..ed98ab4ee23 100644 --- a/make/gendata/Gendata-jdk.compiler.gmk +++ b/make/modules/jdk.compiler/Gendata.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -26,12 +26,11 @@ include JarArchive.gmk include JavaCompilation.gmk include Modules.gmk -include SetupJavaCompilers.gmk ################################################################################ # Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, gendata/Gendata-jdk.compiler-pre.gmk)) +$(eval $(call IncludeCustomExtension, modules/jdk.compiler/Gendata.gmk)) # This is needed to properly setup DOCS_MODULES. $(eval $(call ReadImportMetaData)) @@ -53,12 +52,14 @@ COMPILECREATESYMBOLS_ADD_EXPORTS := \ # $(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := $(TOPDIR)/make/langtools/src/classes \ $(TOPDIR)/src/jdk.jdeps/share/classes, \ INCLUDES := build/tools/symbolgenerator com/sun/tools/classfile, \ BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols, \ - ADD_JAVAC_FLAGS := $(INTERIM_LANGTOOLS_ARGS) \ + DISABLED_WARNINGS := options, \ + JAVAC_FLAGS := \ + $(INTERIM_LANGTOOLS_ARGS) \ --patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \ $(COMPILECREATESYMBOLS_ADD_EXPORTS), \ )) diff --git a/make/gensrc/Gensrc-jdk.compiler.gmk b/make/modules/jdk.compiler/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.compiler.gmk rename to make/modules/jdk.compiler/Gensrc.gmk diff --git a/make/launcher/Launcher-jdk.compiler.gmk b/make/modules/jdk.compiler/Launcher.gmk similarity index 78% rename from make/launcher/Launcher-jdk.compiler.gmk rename to make/modules/jdk.compiler/Launcher.gmk index f71c37adf74..66d24fb4fe6 100644 --- a/make/launcher/Launcher-jdk.compiler.gmk +++ b/make/modules/jdk.compiler/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -35,13 +35,3 @@ $(eval $(call SetupBuildLauncher, serialver, \ MAIN_CLASS := sun.tools.serialver.SerialVer, \ CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ )) - -ifeq ($(ENABLE_SJAVAC), yes) - # Build sjavac directly to the exploded image so that it does not get included - # into any real images - $(eval $(call SetupBuildLauncher, sjavac, \ - MAIN_CLASS := com.sun.tools.sjavac.Main, \ - CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \ - OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \ - )) -endif diff --git a/make/copy/Copy-jdk.crypto.cryptoki.gmk b/make/modules/jdk.crypto.cryptoki/Copy.gmk similarity index 100% rename from make/copy/Copy-jdk.crypto.cryptoki.gmk rename to make/modules/jdk.crypto.cryptoki/Copy.gmk diff --git a/make/lib/Lib-jdk.crypto.cryptoki.gmk b/make/modules/jdk.crypto.cryptoki/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.crypto.cryptoki.gmk rename to make/modules/jdk.crypto.cryptoki/Lib.gmk diff --git a/make/lib/Lib-jdk.crypto.ec.gmk b/make/modules/jdk.crypto.ec/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.crypto.ec.gmk rename to make/modules/jdk.crypto.ec/Lib.gmk diff --git a/make/lib/Lib-jdk.crypto.mscapi.gmk b/make/modules/jdk.crypto.mscapi/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.crypto.mscapi.gmk rename to make/modules/jdk.crypto.mscapi/Lib.gmk diff --git a/make/copy/Copy-jdk.crypto.ucrypto.gmk b/make/modules/jdk.crypto.ucrypto/Copy.gmk similarity index 100% rename from make/copy/Copy-jdk.crypto.ucrypto.gmk rename to make/modules/jdk.crypto.ucrypto/Copy.gmk diff --git a/make/lib/Lib-jdk.crypto.ucrypto.gmk b/make/modules/jdk.crypto.ucrypto/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.crypto.ucrypto.gmk rename to make/modules/jdk.crypto.ucrypto/Lib.gmk diff --git a/make/gensrc/Gensrc-jdk.hotspot.agent.gmk b/make/modules/jdk.hotspot.agent/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.hotspot.agent.gmk rename to make/modules/jdk.hotspot.agent/Gensrc.gmk diff --git a/make/launcher/Launcher-jdk.hotspot.agent.gmk b/make/modules/jdk.hotspot.agent/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.hotspot.agent.gmk rename to make/modules/jdk.hotspot.agent/Launcher.gmk diff --git a/make/lib/Lib-jdk.hotspot.agent.gmk b/make/modules/jdk.hotspot.agent/Lib.gmk similarity index 95% rename from make/lib/Lib-jdk.hotspot.agent.gmk rename to make/modules/jdk.hotspot.agent/Lib.gmk index b05211c301c..c7bb98f313e 100644 --- a/make/lib/Lib-jdk.hotspot.agent.gmk +++ b/make/modules/jdk.hotspot.agent/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ include LibCommon.gmk -$(eval $(call IncludeCustomExtension, hotspot/lib/Lib-jdk.hotspot.agent.gmk)) - ################################################################################ ifeq ($(call isTargetOs, linux), true) diff --git a/make/copy/Copy-jdk.incubator.jextract.gmk b/make/modules/jdk.incubator.jextract/Copy.gmk similarity index 100% rename from make/copy/Copy-jdk.incubator.jextract.gmk rename to make/modules/jdk.incubator.jextract/Copy.gmk diff --git a/make/launcher/Launcher-jdk.incubator.jextract.gmk b/make/modules/jdk.incubator.jextract/Launcher.gmk similarity index 99% rename from make/launcher/Launcher-jdk.incubator.jextract.gmk rename to make/modules/jdk.incubator.jextract/Launcher.gmk index 0f166cf0d86..3b9f92eda21 100644 --- a/make/launcher/Launcher-jdk.incubator.jextract.gmk +++ b/make/modules/jdk.incubator.jextract/Launcher.gmk @@ -29,4 +29,3 @@ $(eval $(call SetupBuildLauncher, jextract,\ CFLAGS := -DENABLE_ARG_FILES, \ MAIN_CLASS := jdk.incubator.jextract.tool.Main, \ )) - diff --git a/make/launcher/Launcher-jdk.incubator.jpackage.gmk b/make/modules/jdk.incubator.jpackage/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.incubator.jpackage.gmk rename to make/modules/jdk.incubator.jpackage/Launcher.gmk diff --git a/make/lib/Lib-jdk.incubator.jpackage.gmk b/make/modules/jdk.incubator.jpackage/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.incubator.jpackage.gmk rename to make/modules/jdk.incubator.jpackage/Lib.gmk diff --git a/make/lib/Lib-jdk.internal.le.gmk b/make/modules/jdk.internal.le/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.internal.le.gmk rename to make/modules/jdk.internal.le/Lib.gmk diff --git a/make/gensrc/Gensrc-jdk.internal.vm.compiler.management.gmk b/make/modules/jdk.internal.vm.compiler.management/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.internal.vm.compiler.management.gmk rename to make/modules/jdk.internal.vm.compiler.management/Gensrc.gmk diff --git a/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk b/make/modules/jdk.internal.vm.compiler/Gensrc.gmk similarity index 97% rename from make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk rename to make/modules/jdk.internal.vm.compiler/Gensrc.gmk index 2fdf530730a..be0b85f462d 100644 --- a/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk +++ b/make/modules/jdk.internal.vm.compiler/Gensrc.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -28,8 +28,6 @@ default: all include $(SPEC) include MakeBase.gmk -$(eval $(call IncludeCustomExtension, gensrc/Gensrc-jdk.internal.vm.compiler.gmk)) - GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE) SRC_DIR := $(TOPDIR)/src/$(MODULE)/share/classes diff --git a/make/gensrc/Gensrc-jdk.jartool.gmk b/make/modules/jdk.jartool/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.jartool.gmk rename to make/modules/jdk.jartool/Gensrc.gmk diff --git a/make/launcher/Launcher-jdk.jartool.gmk b/make/modules/jdk.jartool/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.jartool.gmk rename to make/modules/jdk.jartool/Launcher.gmk diff --git a/make/gensrc/Gensrc-jdk.javadoc.gmk b/make/modules/jdk.javadoc/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.javadoc.gmk rename to make/modules/jdk.javadoc/Gensrc.gmk diff --git a/make/launcher/Launcher-jdk.javadoc.gmk b/make/modules/jdk.javadoc/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.javadoc.gmk rename to make/modules/jdk.javadoc/Launcher.gmk diff --git a/make/launcher/Launcher-jdk.jcmd.gmk b/make/modules/jdk.jcmd/Launcher.gmk similarity index 91% rename from make/launcher/Launcher-jdk.jcmd.gmk rename to make/modules/jdk.jcmd/Launcher.gmk index 7117fa78059..0f171502fe4 100644 --- a/make/launcher/Launcher-jdk.jcmd.gmk +++ b/make/modules/jdk.jcmd/Launcher.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -60,6 +60,3 @@ $(eval $(call SetupBuildLauncher, jstat, \ $(eval $(call SetupBuildLauncher, jcmd, \ MAIN_CLASS := sun.tools.jcmd.JCmd, \ )) - -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, launcher/Launcher-jdk.jcmd-post.gmk)) diff --git a/make/launcher/Launcher-jdk.jconsole.gmk b/make/modules/jdk.jconsole/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.jconsole.gmk rename to make/modules/jdk.jconsole/Launcher.gmk diff --git a/make/gensrc/Gensrc-jdk.jdeps.gmk b/make/modules/jdk.jdeps/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.jdeps.gmk rename to make/modules/jdk.jdeps/Gensrc.gmk diff --git a/make/launcher/Launcher-jdk.jdeps.gmk b/make/modules/jdk.jdeps/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.jdeps.gmk rename to make/modules/jdk.jdeps/Launcher.gmk diff --git a/make/gensrc/Gensrc-jdk.jdi.gmk b/make/modules/jdk.jdi/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.jdi.gmk rename to make/modules/jdk.jdi/Gensrc.gmk diff --git a/make/launcher/Launcher-jdk.jdi.gmk b/make/modules/jdk.jdi/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.jdi.gmk rename to make/modules/jdk.jdi/Launcher.gmk diff --git a/make/lib/Lib-jdk.jdi.gmk b/make/modules/jdk.jdi/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.jdi.gmk rename to make/modules/jdk.jdi/Lib.gmk diff --git a/make/copy/Copy-jdk.jdwp.agent.gmk b/make/modules/jdk.jdwp.agent/Copy.gmk similarity index 100% rename from make/copy/Copy-jdk.jdwp.agent.gmk rename to make/modules/jdk.jdwp.agent/Copy.gmk diff --git a/make/lib/Lib-jdk.jdwp.agent.gmk b/make/modules/jdk.jdwp.agent/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.jdwp.agent.gmk rename to make/modules/jdk.jdwp.agent/Lib.gmk diff --git a/make/copy/Copy-jdk.jfr.gmk b/make/modules/jdk.jfr/Copy.gmk similarity index 100% rename from make/copy/Copy-jdk.jfr.gmk rename to make/modules/jdk.jfr/Copy.gmk diff --git a/make/launcher/Launcher-jdk.jfr.gmk b/make/modules/jdk.jfr/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.jfr.gmk rename to make/modules/jdk.jfr/Launcher.gmk diff --git a/make/gensrc/Gensrc-jdk.jlink.gmk b/make/modules/jdk.jlink/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.jlink.gmk rename to make/modules/jdk.jlink/Gensrc.gmk diff --git a/make/launcher/Launcher-jdk.jlink.gmk b/make/modules/jdk.jlink/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.jlink.gmk rename to make/modules/jdk.jlink/Launcher.gmk diff --git a/make/gensrc/Gensrc-jdk.jshell.gmk b/make/modules/jdk.jshell/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.jshell.gmk rename to make/modules/jdk.jshell/Gensrc.gmk diff --git a/make/launcher/Launcher-jdk.jshell.gmk b/make/modules/jdk.jshell/Launcher.gmk similarity index 100% rename from make/launcher/Launcher-jdk.jshell.gmk rename to make/modules/jdk.jshell/Launcher.gmk diff --git a/make/modules/jdk.jstatd/Launcher.gmk b/make/modules/jdk.jstatd/Launcher.gmk new file mode 100644 index 00000000000..de481b78b6c --- /dev/null +++ b/make/modules/jdk.jstatd/Launcher.gmk @@ -0,0 +1,30 @@ +# +# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +include LauncherCommon.gmk + +$(eval $(call SetupBuildLauncher, jstatd, \ + MAIN_CLASS := sun.tools.jstatd.Jstatd, \ +)) diff --git a/make/gensrc/Gensrc-jdk.localedata.gmk b/make/modules/jdk.localedata/Gensrc.gmk similarity index 91% rename from make/gensrc/Gensrc-jdk.localedata.gmk rename to make/modules/jdk.localedata/Gensrc.gmk index d7fc8ef226b..7812d9d2be1 100644 --- a/make/gensrc/Gensrc-jdk.localedata.gmk +++ b/make/modules/jdk.localedata/Gensrc.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,7 @@ include GensrcCommonJdk.gmk -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, gensrc/Gensrc-jdk.localedata.gmk)) - -include GensrcLocaleData.gmk +include modules/java.base/gensrc/GensrcLocaleData.gmk ################################################################################ diff --git a/make/copy/Copy-jdk.management.agent.gmk b/make/modules/jdk.management.agent/Copy.gmk similarity index 100% rename from make/copy/Copy-jdk.management.agent.gmk rename to make/modules/jdk.management.agent/Copy.gmk diff --git a/make/gensrc/Gensrc-jdk.management.agent.gmk b/make/modules/jdk.management.agent/Gensrc.gmk similarity index 100% rename from make/gensrc/Gensrc-jdk.management.agent.gmk rename to make/modules/jdk.management.agent/Gensrc.gmk diff --git a/make/lib/Lib-jdk.management.agent.gmk b/make/modules/jdk.management.agent/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.management.agent.gmk rename to make/modules/jdk.management.agent/Lib.gmk diff --git a/make/lib/Lib-jdk.management.gmk b/make/modules/jdk.management/Lib.gmk similarity index 85% rename from make/lib/Lib-jdk.management.gmk rename to make/modules/jdk.management/Lib.gmk index e32025ab2f7..6118d2effac 100644 --- a/make/lib/Lib-jdk.management.gmk +++ b/make/modules/jdk.management/Lib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,6 @@ include LibCommon.gmk -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, lib/Lib-jdk.management.gmk)) - ################################################################################ ifeq ($(call isTargetOs, windows), true) @@ -60,8 +57,3 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \ $(BUILD_LIBMANAGEMENT_EXT): $(call FindLib, java.base, java) TARGETS += $(BUILD_LIBMANAGEMENT_EXT) - -################################################################################ - -# Include custom extension post hook -$(eval $(call IncludeCustomExtension, lib/Lib-jdk.management-post.gmk)) diff --git a/make/lib/Lib-jdk.net.gmk b/make/modules/jdk.net/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.net.gmk rename to make/modules/jdk.net/Lib.gmk diff --git a/make/lib/Lib-jdk.sctp.gmk b/make/modules/jdk.sctp/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.sctp.gmk rename to make/modules/jdk.sctp/Lib.gmk diff --git a/make/lib/Lib-jdk.security.auth.gmk b/make/modules/jdk.security.auth/Lib.gmk similarity index 100% rename from make/lib/Lib-jdk.security.auth.gmk rename to make/modules/jdk.security.auth/Lib.gmk diff --git a/make/test/BuildFailureHandler.gmk b/make/test/BuildFailureHandler.gmk index 3af3c5b5d17..d0a81a11eed 100644 --- a/make/test/BuildFailureHandler.gmk +++ b/make/test/BuildFailureHandler.gmk @@ -28,7 +28,6 @@ default: build include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk include NativeCompilation.gmk TARGETS := @@ -49,13 +48,14 @@ TOOLS_JAR := $(wildcard $(BOOT_JDK)/lib/tools.jar) FH_CLASSPATH := $(call PathList, $(JTREG_JAR) $(TOOLS_JAR)) $(eval $(call SetupJavaCompilation, BUILD_FAILURE_HANDLER, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := $(FH_BASEDIR)/src/share/classes $(FH_BASEDIR)/src/share/conf, \ BIN := $(FH_SUPPORT)/classes, \ - DISABLED_WARNINGS := serial try, \ + DISABLED_WARNINGS := options serial try, \ COPY := .properties, \ CLASSPATH := $(JTREG_JAR) $(TOOLS_JAR), \ JAR := $(FH_JAR), \ + JAVAC_FLAGS := -XDstringConcat=inline, \ )) TARGETS += $(BUILD_FAILURE_HANDLER) diff --git a/make/test/BuildMicrobenchmark.gmk b/make/test/BuildMicrobenchmark.gmk index 08339d00ef3..55e5026eb38 100644 --- a/make/test/BuildMicrobenchmark.gmk +++ b/make/test/BuildMicrobenchmark.gmk @@ -29,7 +29,6 @@ default: all include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk include TestFilesCompilation.gmk ifeq ($(JMH_CORE_JAR), ) @@ -74,34 +73,27 @@ MICROBENCHMARK_MANIFEST := Build: $(FULL_VERSION)\n\ #### Compile Indify tool $(eval $(call SetupJavaCompilation, BUILD_INDIFY, \ - SETUP := GENERATE_OLDBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \ SRC := $(TOPDIR)/test/jdk/java/lang/invoke, \ INCLUDE_FILES := indify/Indify.java, \ - DISABLED_WARNINGS := rawtypes serial, \ + DISABLED_WARNINGS := rawtypes serial options, \ BIN := $(MICROBENCHMARK_TOOLS_CLASSES), \ + JAVAC_FLAGS := -XDstringConcat=inline -Xprefer:newer, \ )) #### Compile Targets -# Building microbenchmark requires the jdk.unsupported and java.management modules, -# and to have sjavac disabled. -$(eval $(call SetupJavaCompiler, MICROBENCHMARK_JAVA_COMPILER, \ - JVM := $(JAVA) --add-modules jdk.unsupported --limit-modules java.management, \ - JAVAC := $(NEW_JAVAC), \ - DISABLE_SJAVAC := true, \ - FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \ - -Xlint:all -Werror, \ - SERVER_DIR := $(SJAVAC_SERVER_DIR), \ - SERVER_JVM := $(SJAVAC_SERVER_JAVA), \ -)) +# Building microbenchmark requires the jdk.unsupported and java.management modules. # Build microbenchmark suite for the current JDK $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \ - SETUP := MICROBENCHMARK_JAVA_COMPILER, \ - ADD_JAVAC_FLAGS := -cp $(MICROBENCHMARK_CLASSPATH), \ + TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ + SMALL_JAVA := false, \ + CLASSPATH := $(MICROBENCHMARK_CLASSPATH), \ DISABLED_WARNINGS := processing rawtypes cast serial, \ SRC := $(MICROBENCHMARK_SRC), \ BIN := $(MICROBENCHMARK_CLASSES), \ + JAVA_FLAGS := --add-modules jdk.unsupported --limit-modules java.management, \ )) $(BUILD_JDK_MICROBENCHMARK): $(JMH_COMPILE_JARS) diff --git a/make/test/BuildTestLib.gmk b/make/test/BuildTestLib.gmk index 7593ac74766..833919a94fe 100644 --- a/make/test/BuildTestLib.gmk +++ b/make/test/BuildTestLib.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ default: all include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -include SetupJavaCompilers.gmk TARGETS := @@ -36,18 +35,17 @@ TEST_LIB_SOURCE_DIR := $(TOPDIR)/test/lib TEST_LIB_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/lib $(eval $(call SetupJavaCompilation, BUILD_WB_JAR, \ - SETUP := GENERATE_USINGJDKBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ SRC := $(TEST_LIB_SOURCE_DIR)/sun, \ BIN := $(TEST_LIB_SUPPORT)/wb_classes, \ JAR := $(TEST_LIB_SUPPORT)/wb.jar, \ - ADD_JAVAC_FLAGS := $(JAVAC_WARNINGS), \ )) TARGETS += $(BUILD_WB_JAR) # test-lib.jar will contain only hprof classes until JDK-8081381 is resolved $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \ - SETUP := GENERATE_USINGJDKBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ SRC := $(TEST_LIB_SOURCE_DIR)/jdk/test/lib/hprof, \ BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \ JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \ diff --git a/make/test/JtregGraalUnit.gmk b/make/test/JtregGraalUnit.gmk index 3bf1dc44f20..f2403b78bb8 100644 --- a/make/test/JtregGraalUnit.gmk +++ b/make/test/JtregGraalUnit.gmk @@ -33,7 +33,7 @@ default: all include $(SPEC) include MakeBase.gmk -include SetupJavaCompilers.gmk +include JavaCompilation.gmk TARGETS_BUILD := TARGETS_IMAGE := @@ -65,6 +65,8 @@ ifeq ($(INCLUDE_GRAAL), true) --add-exports jdk.unsupported/sun.misc=ALL-UNNAMED \ --add-exports java.base/jdk.internal.misc=ALL-UNNAMED \ --add-exports java.base/jdk.internal.module=ALL-UNNAMED \ + -Xprefer:newer \ + # ### Copy 3rd party libs $(eval $(call SetupCopyFiles, COPY_GRAALUNIT_LIBS, \ @@ -76,7 +78,7 @@ ifeq ($(INCLUDE_GRAAL), true) ### Compile graalunit tests $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_TESTS, \ - SETUP := GENERATE_USINGJDKBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ SRC := \ $(SRC_DIR)/jdk.internal.vm.compiler.collections.test/src \ $(SRC_DIR)/org.graalvm.compiler.api.directives.test/src \ @@ -93,6 +95,7 @@ ifeq ($(INCLUDE_GRAAL), true) $(SRC_DIR)/org.graalvm.compiler.graph.test/src \ $(SRC_DIR)/org.graalvm.compiler.hotspot.aarch64.test/src \ $(SRC_DIR)/org.graalvm.compiler.hotspot.amd64.test/src \ + $(SRC_DIR)/org.graalvm.compiler.hotspot.jdk15.test/src \ $(SRC_DIR)/org.graalvm.compiler.hotspot.jdk9.test/src \ $(SRC_DIR)/org.graalvm.compiler.hotspot.lir.test/src \ $(SRC_DIR)/org.graalvm.compiler.hotspot.sparc.test/src \ @@ -114,7 +117,7 @@ ifeq ($(INCLUDE_GRAAL), true) BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \ CLASSPATH := $(TEST_COMPILE_CP), \ DISABLED_WARNINGS := processing, \ - ADD_JAVAC_FLAGS := $(TEST_JAVAC_FLAGS), \ + JAVAC_FLAGS := $(TEST_JAVAC_FLAGS), \ COPY := .input, \ )) @@ -122,20 +125,16 @@ ifeq ($(INCLUDE_GRAAL), true) ### Compile graalunit tests which require -XDstringConcat=inline $(eval $(call SetupJavaCompilation, BUILD_VM_COMPILER_TESTS_SET2, \ - SETUP := GENERATE_USINGJDKBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ DEPENDS := $(BUILD_VM_COMPILER_TESTS), \ SRC := $(SRC_DIR)/org.graalvm.compiler.core.test/src, \ INCLUDE_FILES := org/graalvm/compiler/core/test/VerifyDebugUsageTest.java, \ BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \ CLASSPATH := \ $(TEST_COMPILE_CP) \ - $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests \ - , \ + $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \ DISABLED_WARNINGS := processing, \ - ADD_JAVAC_FLAGS := \ - $(TEST_JAVAC_FLAGS) \ - -XDstringConcat=inline \ - , \ + JAVAC_FLAGS := $(TEST_JAVAC_FLAGS) -XDstringConcat=inline, \ )) TARGETS_BUILD += $(BUILD_VM_COMPILER_TESTS_SET2) @@ -152,7 +151,7 @@ ifeq ($(INCLUDE_GRAAL), true) ### Compile and build mxtool $(eval $(call SetupJavaCompilation, BUILD_MXTOOL, \ - SETUP := GENERATE_USINGJDKBYTECODE, \ + TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ SRC := $(TEST_DIR)/com.oracle.mxtool.junit, \ BIN := $(COMPILE_OUTPUTDIR)/com.oracle.mxtool.junit, \ JAR := $(COMPILE_OUTPUTDIR)/com.oracle.mxtool.junit.jar, \ diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 9a5ae03dcae..b72ecef0f28 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -1635,6 +1635,20 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const { st->print("mov rscratch1, #%d\n\t", framesize - 2 * wordSize); st->print("sub sp, sp, rscratch1"); } + if (C->stub_function() == NULL && BarrierSet::barrier_set()->barrier_set_nmethod() != NULL) { + st->print("\n\t"); + st->print("ldr rscratch1, [guard]\n\t"); + st->print("dmb ishld\n\t"); + st->print("ldr rscratch2, [rthread, #thread_disarmed_offset]\n\t"); + st->print("cmp rscratch1, rscratch2\n\t"); + st->print("b.eq skip"); + st->print("\n\t"); + st->print("blr #nmethod_entry_barrier_stub\n\t"); + st->print("b skip\n\t"); + st->print("guard: int\n\t"); + st->print("\n\t"); + st->print("skip:\n\t"); + } } #endif @@ -1667,6 +1681,11 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { __ build_frame(framesize); + if (C->stub_function() == NULL) { + BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->nmethod_entry_barrier(&_masm); + } + if (VerifyStackAtCalls) { Unimplemented(); } @@ -13208,7 +13227,7 @@ instruct sqrtD_reg(vRegD dst, vRegD src) %{ %} instruct sqrtF_reg(vRegF dst, vRegF src) %{ - match(Set dst (ConvD2F (SqrtD (ConvF2D src)))); + match(Set dst (SqrtF src)); ins_cost(INSN_COST * 50); format %{ "fsqrts $dst, $src" %} @@ -17022,6 +17041,28 @@ instruct vdiv2D(vecX dst, vecX src1, vecX src2) // --------------------------------- SQRT ------------------------------------- +instruct vsqrt2F(vecD dst, vecD src) +%{ + predicate(n->as_Vector()->length() == 2); + match(Set dst (SqrtVF src)); + format %{ "fsqrt $dst, $src\t# vector (2F)" %} + ins_encode %{ + __ fsqrt(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg)); + %} + ins_pipe(vunop_fp64); +%} + +instruct vsqrt4F(vecX dst, vecX src) +%{ + predicate(n->as_Vector()->length() == 4); + match(Set dst (SqrtVF src)); + format %{ "fsqrt $dst, $src\t# vector (4F)" %} + ins_encode %{ + __ fsqrt(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); + %} + ins_pipe(vsqrt_fp128); +%} + instruct vsqrt2D(vecX dst, vecX src) %{ predicate(n->as_Vector()->length() == 2); diff --git a/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp index 34afe05e857..4ca1062bc6d 100644 --- a/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp @@ -27,6 +27,7 @@ #include "c1/c1_MacroAssembler.hpp" #include "c1/c1_Runtime1.hpp" #include "classfile/systemDictionary.hpp" +#include "gc/shared/barrierSetAssembler.hpp" #include "gc/shared/collectedHeap.hpp" #include "interpreter/interpreter.hpp" #include "oops/arrayOop.hpp" @@ -336,6 +337,10 @@ void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes) { // Note that we do this before doing an enter(). generate_stack_overflow_check(bang_size_in_bytes); MacroAssembler::build_frame(framesize + 2 * wordSize); + + // Insert nmethod entry barrier into frame. + BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->nmethod_entry_barrier(this); } void C1_MacroAssembler::remove_frame(int framesize) { diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp index b04c0430d49..daf12fe111d 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,12 +23,17 @@ */ #include "precompiled.hpp" +#include "gc/shared/barrierSet.hpp" #include "gc/shared/barrierSetAssembler.hpp" +#include "gc/shared/barrierSetNMethod.hpp" #include "gc/shared/collectedHeap.hpp" +#include "interpreter/interp_masm.hpp" #include "memory/universe.hpp" #include "runtime/jniHandles.hpp" +#include "runtime/sharedRuntime.hpp" #include "runtime/thread.hpp" + #define __ masm-> void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, @@ -229,3 +234,67 @@ void BarrierSetAssembler::incr_allocated_bytes(MacroAssembler* masm, } __ str(t1, Address(rthread, in_bytes(JavaThread::allocated_bytes_offset()))); } + +void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) { + BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); + + if (bs_nm == NULL) { + return; + } + + Label skip, guard; + Address thread_disarmed_addr(rthread, in_bytes(bs_nm->thread_disarmed_offset())); + + __ ldrw(rscratch1, guard); + + // Subsequent loads of oops must occur after load of guard value. + // BarrierSetNMethod::disarm sets guard with release semantics. + __ membar(__ LoadLoad); + __ ldrw(rscratch2, thread_disarmed_addr); + __ cmpw(rscratch1, rscratch2); + __ br(Assembler::EQ, skip); + + __ mov(rscratch1, StubRoutines::aarch64::method_entry_barrier()); + __ blr(rscratch1); + __ b(skip); + + __ bind(guard); + + __ emit_int32(0); // nmethod guard value. Skipped over in common case. + + __ bind(skip); +} + +void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler* masm) { + BarrierSetNMethod* bs = BarrierSet::barrier_set()->barrier_set_nmethod(); + if (bs == NULL) { + return; + } + + Label bad_call; + __ cbz(rmethod, bad_call); + + // Pointer chase to the method holder to find out if the method is concurrently unloading. + Label method_live; + __ load_method_holder_cld(rscratch1, rmethod); + + // Is it a strong CLD? + __ ldr(rscratch2, Address(rscratch1, ClassLoaderData::keep_alive_offset())); + __ cbnz(rscratch2, method_live); + + // Is it a weak but alive CLD? + __ stp(r10, r11, Address(__ pre(sp, -2 * wordSize))); + __ ldr(r10, Address(rscratch1, ClassLoaderData::holder_offset())); + + // Uses rscratch1 & rscratch2, so we must pass new temporaries. + __ resolve_weak_handle(r10, r11); + __ mov(rscratch1, r10); + __ ldp(r10, r11, Address(__ post(sp, 2 * wordSize))); + __ cbnz(rscratch1, method_live); + + __ bind(bad_call); + + __ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub())); + __ bind(method_live); +} + diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp index 0f730ff5d98..76f185ca227 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,8 @@ #define CPU_AARCH64_GC_SHARED_BARRIERSETASSEMBLER_AARCH64_HPP #include "asm/macroAssembler.hpp" +#include "gc/shared/barrierSet.hpp" +#include "gc/shared/barrierSetNMethod.hpp" #include "memory/allocation.hpp" #include "oops/access.hpp" @@ -72,6 +74,10 @@ class BarrierSetAssembler: public CHeapObj { Label& slow_case // continuation point if fast allocation fails ); virtual void barrier_stubs_init() {} + + virtual void nmethod_entry_barrier(MacroAssembler* masm); + virtual void c2i_entry_barrier(MacroAssembler* masm); + }; #endif // CPU_AARCH64_GC_SHARED_BARRIERSETASSEMBLER_AARCH64_HPP diff --git a/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp index a0361ddc2f4..4ab358a23de 100644 --- a/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,18 +23,143 @@ */ #include "precompiled.hpp" +#include "code/codeCache.hpp" +#include "code/nativeInst.hpp" #include "gc/shared/barrierSetNMethod.hpp" +#include "logging/log.hpp" +#include "memory/resourceArea.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/thread.hpp" +#include "utilities/align.hpp" #include "utilities/debug.hpp" +class NativeNMethodBarrier: public NativeInstruction { + address instruction_address() const { return addr_at(0); } + + int *guard_addr() { + return reinterpret_cast(instruction_address() + 10 * 4); + } + +public: + int get_value() { + return Atomic::load_acquire(guard_addr()); + } + + void set_value(int value) { + Atomic::release_store(guard_addr(), value); + } + + void verify() const; +}; + +// Store the instruction bitmask, bits and name for checking the barrier. +struct CheckInsn { + uint32_t mask; + uint32_t bits; + const char *name; +}; + +static const struct CheckInsn barrierInsn[] = { + { 0xff000000, 0x18000000, "ldr (literal)" }, + { 0xfffff0ff, 0xd50330bf, "dmb" }, + { 0xffc00000, 0xb9400000, "ldr"}, + { 0x7f20001f, 0x6b00001f, "cmp"}, + { 0xff00001f, 0x54000000, "b.eq"}, + { 0xff800000, 0xd2800000, "mov"}, + { 0xff800000, 0xf2800000, "movk"}, + { 0xff800000, 0xf2800000, "movk"}, + { 0xfffffc1f, 0xd63f0000, "blr"}, + { 0xfc000000, 0x14000000, "b"} +}; + +// The encodings must match the instructions emitted by +// BarrierSetAssembler::nmethod_entry_barrier. The matching ignores the specific +// register numbers and immediate values in the encoding. +void NativeNMethodBarrier::verify() const { + intptr_t addr = (intptr_t) instruction_address(); + for(unsigned int i = 0; i < sizeof(barrierInsn)/sizeof(struct CheckInsn); i++ ) { + uint32_t inst = *((uint32_t*) addr); + if ((inst & barrierInsn[i].mask) != barrierInsn[i].bits) { + tty->print_cr("Addr: " INTPTR_FORMAT " Code: 0x%x", addr, inst); + fatal("not an %s instruction.", barrierInsn[i].name); + } + addr +=4; + } +} + + +/* We're called from an nmethod when we need to deoptimize it. We do + this by throwing away the nmethod's frame and jumping to the + ic_miss stub. This looks like there has been an IC miss at the + entry of the nmethod, so we resolve the call, which will fall back + to the interpreter if the nmethod has been unloaded. */ void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) { - ShouldNotReachHere(); + + typedef struct { + intptr_t *sp; intptr_t *fp; address lr; address pc; + } frame_pointers_t; + + frame_pointers_t *new_frame = (frame_pointers_t *)(return_address_ptr - 5); + + JavaThread *thread = (JavaThread*)Thread::current(); + RegisterMap reg_map(thread, false); + frame frame = thread->last_frame(); + + assert(frame.is_compiled_frame() || frame.is_native_frame(), "must be"); + assert(frame.cb() == nm, "must be"); + frame = frame.sender(®_map); + + LogTarget(Trace, nmethod, barrier) out; + if (out.is_enabled()) { + Thread* thread = Thread::current(); + assert(thread->is_Java_thread(), "must be JavaThread"); + JavaThread* jth = (JavaThread*) thread; + ResourceMark mark; + log_trace(nmethod, barrier)("deoptimize(nmethod: %s(%p), return_addr: %p, osr: %d, thread: %p(%s), making rsp: %p) -> %p", + nm->method()->name_and_sig_as_C_string(), + nm, *(address *) return_address_ptr, nm->is_osr_method(), jth, + jth->get_thread_name(), frame.sp(), nm->verified_entry_point()); + } + + new_frame->sp = frame.sp(); + new_frame->fp = frame.fp(); + new_frame->lr = frame.pc(); + new_frame->pc = SharedRuntime::get_handle_wrong_method_stub(); +} + +// This is the offset of the entry barrier from where the frame is completed. +// If any code changes between the end of the verified entry where the entry +// barrier resides, and the completion of the frame, then +// NativeNMethodCmpBarrier::verify() will immediately complain when it does +// not find the expected native instruction at this offset, which needs updating. +// Note that this offset is invariant of PreserveFramePointer. + +static const int entry_barrier_offset = -4 * 11; + +static NativeNMethodBarrier* native_nmethod_barrier(nmethod* nm) { + address barrier_address = nm->code_begin() + nm->frame_complete_offset() + entry_barrier_offset; + NativeNMethodBarrier* barrier = reinterpret_cast(barrier_address); + debug_only(barrier->verify()); + return barrier; } void BarrierSetNMethod::disarm(nmethod* nm) { - ShouldNotReachHere(); + if (!supports_entry_barrier(nm)) { + return; + } + + // Disarms the nmethod guard emitted by BarrierSetAssembler::nmethod_entry_barrier. + // Symmetric "LDR; DMB ISHLD" is in the nmethod barrier. + NativeNMethodBarrier* barrier = native_nmethod_barrier(nm); + + barrier->set_value(disarmed_value()); } bool BarrierSetNMethod::is_armed(nmethod* nm) { - ShouldNotReachHere(); - return false; + if (!supports_entry_barrier(nm)) { + return false; + } + + NativeNMethodBarrier* barrier = native_nmethod_barrier(nm); + return barrier->get_value() != disarmed_value(); } diff --git a/src/hotspot/cpu/aarch64/gc/z/zArguments_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/z/zArguments_aarch64.cpp index d94bc52877a..3b49dff1825 100644 --- a/src/hotspot/cpu/aarch64/gc/z/zArguments_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/z/zArguments_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,12 +23,7 @@ #include "precompiled.hpp" #include "gc/z/zArguments.hpp" -#include "runtime/globals.hpp" -#include "runtime/globals_extension.hpp" -#include "utilities/debug.hpp" void ZArguments::initialize_platform() { - // Disable class unloading - we don't support concurrent class unloading yet. - FLAG_SET_DEFAULT(ClassUnloading, false); - FLAG_SET_DEFAULT(ClassUnloadingWithConcurrentMark, false); + // Does nothing } diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index a50f86b7bd8..cde98f24cc3 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -3693,6 +3693,11 @@ void MacroAssembler::cmpoop(Register obj1, Register obj2) { bs->obj_equals(this, obj1, obj2); } +void MacroAssembler::load_method_holder_cld(Register rresult, Register rmethod) { + load_method_holder(rresult, rmethod); + ldr(rresult, Address(rresult, InstanceKlass::class_loader_data_offset())); +} + void MacroAssembler::load_method_holder(Register holder, Register method) { ldr(holder, Address(method, Method::const_offset())); // ConstMethod* ldr(holder, Address(holder, ConstMethod::constants_offset())); // ConstantPool* @@ -3714,6 +3719,22 @@ void MacroAssembler::resolve_oop_handle(Register result, Register tmp) { access_load_at(T_OBJECT, IN_NATIVE, result, Address(result, 0), tmp, noreg); } +// ((WeakHandle)result).resolve(); +void MacroAssembler::resolve_weak_handle(Register rresult, Register rtmp) { + assert_different_registers(rresult, rtmp); + Label resolved; + + // A null weak handle resolves to null. + cbz(rresult, resolved); + + // Only 64 bit platforms support GCs that require a tmp register + // Only IN_HEAP loads require a thread_tmp register + // WeakHandle::resolve is an indirection like jweak. + access_load_at(T_OBJECT, IN_NATIVE | ON_PHANTOM_OOP_REF, + rresult, Address(rresult), rtmp, /*tmp_thread*/noreg); + bind(resolved); +} + void MacroAssembler::load_mirror(Register dst, Register method, Register tmp) { const int mirror_offset = in_bytes(Klass::java_mirror_offset()); ldr(dst, Address(rmethod, Method::const_offset())); @@ -4108,9 +4129,9 @@ Address MacroAssembler::allocate_metadata_address(Metadata* obj) { } // Move an oop into a register. immediate is true if we want -// immediate instrcutions, i.e. we are not going to patch this -// instruction while the code is being executed by another thread. In -// that case we can use move immediates rather than the constant pool. +// immediate instructions and nmethod entry barriers are not enabled. +// i.e. we are not going to patch this instruction while the code is being +// executed by another thread. void MacroAssembler::movoop(Register dst, jobject obj, bool immediate) { int oop_index; if (obj == NULL) { @@ -4125,11 +4146,16 @@ void MacroAssembler::movoop(Register dst, jobject obj, bool immediate) { oop_index = oop_recorder()->find_index(obj); } RelocationHolder rspec = oop_Relocation::spec(oop_index); - if (! immediate) { + + // nmethod entry barrier necessitate using the constant pool. They have to be + // ordered with respected to oop accesses. + // Using immediate literals would necessitate ISBs. + if (BarrierSet::barrier_set()->barrier_set_nmethod() != NULL || !immediate) { address dummy = address(uintptr_t(pc()) & -wordSize); // A nearby aligned address ldr_constant(dst, Address(dummy, rspec)); } else mov(dst, Address((address)obj, rspec)); + } // Move a metadata address into a register. diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp index d337e90b81f..00345ae30cc 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved. + * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -176,6 +176,8 @@ class MacroAssembler: public Assembler { using Assembler::ldr; using Assembler::str; + using Assembler::ldrw; + using Assembler::strw; void ldr(Register Rx, const Address &adr); void ldrw(Register Rw, const Address &adr); @@ -809,6 +811,7 @@ class MacroAssembler: public Assembler { // C 'boolean' to Java boolean: x == 0 ? 0 : 1 void c2bool(Register x); + void load_method_holder_cld(Register rresult, Register rmethod); void load_method_holder(Register holder, Register method); // oop manipulations @@ -816,6 +819,7 @@ class MacroAssembler: public Assembler { void store_klass(Register dst, Register src); void cmp_klass(Register oop, Register trial_klass, Register tmp); + void resolve_weak_handle(Register result, Register tmp); void resolve_oop_handle(Register result, Register tmp = r5); void load_mirror(Register dst, Register method, Register tmp = r5); diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp index c8c0c956e3a..b25a579d9a9 100644 --- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp @@ -29,6 +29,7 @@ #include "code/debugInfoRec.hpp" #include "code/icBuffer.hpp" #include "code/vtableStubs.hpp" +#include "gc/shared/barrierSetAssembler.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interp_masm.hpp" #include "logging/log.hpp" @@ -732,6 +733,9 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm c2i_no_clinit_check_entry = __ pc(); } + BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->c2i_entry_barrier(masm); + gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup); __ flush(); @@ -1504,6 +1508,9 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, // -2 because return address is already present and so is saved rfp __ sub(sp, sp, stack_size - 2*wordSize); + BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->nmethod_entry_barrier(masm); + // Frame is now completed as far as size and linkage. int frame_complete = ((intptr_t)__ pc()) - start; diff --git a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp index 48aa12c2c79..c872e56ae36 100644 --- a/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -4155,6 +4155,50 @@ class StubGenerator: public StubCodeGenerator { return entry; } + address generate_method_entry_barrier() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "nmethod_entry_barrier"); + + Label deoptimize_label; + + address start = __ pc(); + + __ set_last_Java_frame(sp, rfp, lr, rscratch1); + + __ enter(); + __ add(rscratch2, sp, wordSize); // rscratch2 points to the saved lr + + __ sub(sp, sp, 4 * wordSize); // four words for the returned {sp, fp, lr, pc} + + __ push_call_clobbered_registers(); + + __ mov(c_rarg0, rscratch2); + __ call_VM_leaf + (CAST_FROM_FN_PTR + (address, BarrierSetNMethod::nmethod_stub_entry_barrier), 1); + + __ reset_last_Java_frame(true); + + __ mov(rscratch1, r0); + + __ pop_call_clobbered_registers(); + + __ cbnz(rscratch1, deoptimize_label); + + __ leave(); + __ ret(lr); + + __ BIND(deoptimize_label); + + __ ldp(/* new sp */ rscratch1, rfp, Address(sp, 0 * wordSize)); + __ ldp(lr, /* new pc*/ rscratch2, Address(sp, 2 * wordSize)); + + __ mov(sp, rscratch1); + __ br(rscratch2); + + return start; + } + // r0 = result // r1 = str1 // r2 = cnt1 @@ -5745,6 +5789,10 @@ class StubGenerator: public StubCodeGenerator { // byte_array_inflate stub for large arrays. StubRoutines::aarch64::_large_byte_array_inflate = generate_large_byte_array_inflate(); + BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); + if (bs_nm != NULL) { + StubRoutines::aarch64::_method_entry_barrier = generate_method_entry_barrier(); + } #ifdef COMPILER2 if (UseMultiplyToLenIntrinsic) { StubRoutines::_multiplyToLen = generate_multiplyToLen(); diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp index 7ca26241541..c2a278d3a7a 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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. * @@ -56,6 +56,7 @@ address StubRoutines::aarch64::_string_indexof_linear_ll = NULL; address StubRoutines::aarch64::_string_indexof_linear_uu = NULL; address StubRoutines::aarch64::_string_indexof_linear_ul = NULL; address StubRoutines::aarch64::_large_byte_array_inflate = NULL; +address StubRoutines::aarch64::_method_entry_barrier = NULL; bool StubRoutines::aarch64::_completed = false; /** diff --git a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp index 5fcce2a44cb..4ace7b5c808 100644 --- a/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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. * @@ -69,6 +69,9 @@ class aarch64 { static address _string_indexof_linear_uu; static address _string_indexof_linear_ul; static address _large_byte_array_inflate; + + static address _method_entry_barrier; + static bool _completed; public: @@ -171,6 +174,10 @@ class aarch64 { return _large_byte_array_inflate; } + static address method_entry_barrier() { + return _method_entry_barrier; + } + static bool complete() { return _completed; } diff --git a/src/hotspot/cpu/ppc/vm_version_ppc.cpp b/src/hotspot/cpu/ppc/vm_version_ppc.cpp index 450e9c40509..7d21a99e921 100644 --- a/src/hotspot/cpu/ppc/vm_version_ppc.cpp +++ b/src/hotspot/cpu/ppc/vm_version_ppc.cpp @@ -209,15 +209,10 @@ void VM_Version::initialize() { if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) AllocatePrefetchStyle = 1; - if (AllocatePrefetchStyle == 4) { - AllocatePrefetchStepSize = cache_line_size; // Need exact value. - if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 12; // Use larger blocks by default. - if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 2*cache_line_size; // Default is not defined? - } else { - if (cache_line_size > AllocatePrefetchStepSize) AllocatePrefetchStepSize = cache_line_size; - if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 3; // Optimistic value. - if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 3*cache_line_size; // Default is not defined? - } + if (cache_line_size > AllocatePrefetchStepSize) AllocatePrefetchStepSize = cache_line_size; + // PPC processors have an automatic prefetch engine. + if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 1; + if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 3 * cache_line_size; assert(AllocatePrefetchLines > 0, "invalid value"); if (AllocatePrefetchLines < 1) { // Set valid value in product VM. diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 1cf49f9319f..2a9f5182024 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -110,6 +110,7 @@ # include # include # include +# include #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -1845,9 +1846,6 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { char* name; // String representation } arch_t; -#ifndef EM_486 - #define EM_486 6 /* Intel 80486 */ -#endif #ifndef EM_AARCH64 #define EM_AARCH64 183 /* ARM AARCH64 */ #endif @@ -2061,6 +2059,13 @@ static bool _print_ascii_file(const char* filename, outputStream* st, const char return true; } +static void _print_ascii_file_h(const char* header, const char* filename, outputStream* st) { + st->print("%s", header); + if (!_print_ascii_file(filename, st)) { + st->print_cr(""); + } +} + void os::print_dll_info(outputStream *st) { st->print_cr("Dynamic libraries:"); @@ -2503,6 +2508,54 @@ static bool print_model_name_and_flags(outputStream* st, char* buf, size_t bufle return false; } +// additional information about CPU e.g. available frequency ranges +static void print_sys_devices_cpu_info(outputStream* st, char* buf, size_t buflen) { + _print_ascii_file_h("Online cpus:", "/sys/devices/system/cpu/online", st); + _print_ascii_file_h("Offline cpus:", "/sys/devices/system/cpu/offline", st); + + if (ExtensiveErrorReports) { + // cache related info (cpu 0, should be similar for other CPUs) + for (unsigned int i=0; i < 10; i++) { // handle max. 10 cache entries + char hbuf_level[60]; + char hbuf_type[60]; + char hbuf_size[60]; + char hbuf_coherency_line_size[80]; + snprintf(hbuf_level, 60, "/sys/devices/system/cpu/cpu0/cache/index%u/level", i); + snprintf(hbuf_type, 60, "/sys/devices/system/cpu/cpu0/cache/index%u/type", i); + snprintf(hbuf_size, 60, "/sys/devices/system/cpu/cpu0/cache/index%u/size", i); + snprintf(hbuf_coherency_line_size, 80, "/sys/devices/system/cpu/cpu0/cache/index%u/coherency_line_size", i); + if (file_exists(hbuf_level)) { + _print_ascii_file_h("cache level:", hbuf_level, st); + _print_ascii_file_h("cache type:", hbuf_type, st); + _print_ascii_file_h("cache size:", hbuf_size, st); + _print_ascii_file_h("cache coherency line size:", hbuf_coherency_line_size, st); + } + } + } + + // we miss the cpufreq entries on Power and s390x +#if defined(IA32) || defined(AMD64) + _print_ascii_file_h("BIOS frequency limitation:", "/sys/devices/system/cpu/cpu0/cpufreq/bios_limit", st); + _print_ascii_file_h("Frequency switch latency (ns):", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency", st); + _print_ascii_file_h("Available cpu frequencies:", "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies", st); + // min and max should be in the Available range but still print them (not all info might be available for all kernels) + if (ExtensiveErrorReports) { + _print_ascii_file_h("Maximum cpu frequency:", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq", st); + _print_ascii_file_h("Minimum cpu frequency:", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq", st); + _print_ascii_file_h("Current cpu frequency:", "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", st); + } + // governors are power schemes, see https://wiki.archlinux.org/index.php/CPU_frequency_scaling + if (ExtensiveErrorReports) { + _print_ascii_file_h("Available governors:", "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors", st); + } + _print_ascii_file_h("Current governor:", "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", st); + // Core performance boost, see https://www.kernel.org/doc/Documentation/cpu-freq/boost.txt + // Raise operating frequency of some cores in a multi-core package if certain conditions apply, e.g. + // whole chip is not fully utilized + _print_ascii_file_h("Core performance/turbo boost:", "/sys/devices/system/cpu/cpufreq/boost", st); +#endif +} + void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { // Only print the model name if the platform provides this as a summary if (!print_model_name_and_flags(st, buf, buflen)) { @@ -2511,6 +2564,7 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { st->print_cr(" "); } } + print_sys_devices_cpu_info(st, buf, buflen); } #if defined(AMD64) || defined(IA32) || defined(X32) diff --git a/src/hotspot/os/solaris/os_solaris.cpp b/src/hotspot/os/solaris/os_solaris.cpp index c4608cf9f73..98671360d65 100644 --- a/src/hotspot/os/solaris/os_solaris.cpp +++ b/src/hotspot/os/solaris/os_solaris.cpp @@ -1425,10 +1425,6 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { char* name; // String representation } arch_t; -#ifndef EM_AARCH64 - #define EM_AARCH64 183 /* ARM AARCH64 */ -#endif - static const arch_t arch_array[]={ {EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, {EM_486, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, diff --git a/src/hotspot/share/classfile/classLoaderData.cpp b/src/hotspot/share/classfile/classLoaderData.cpp index 4534d4fe1fc..43e332eab13 100644 --- a/src/hotspot/share/classfile/classLoaderData.cpp +++ b/src/hotspot/share/classfile/classLoaderData.cpp @@ -640,8 +640,8 @@ class ReleaseKlassClosure: public KlassClosure { } else { assert(k->is_instance_klass(), "Must be"); _instance_class_released ++; - InstanceKlass::release_C_heap_structures(InstanceKlass::cast(k)); } + k->release_C_heap_structures(); } }; @@ -869,7 +869,7 @@ void ClassLoaderData::free_deallocate_list_C_heap_structures() { } else if (m->is_klass()) { InstanceKlass* ik = (InstanceKlass*)m; // also releases ik->constants() C heap memory - InstanceKlass::release_C_heap_structures(ik); + ik->release_C_heap_structures(); // Remove the class so unloading events aren't triggered for // this class (scratch or error class) in do_unloading(). remove_class(ik); diff --git a/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp index 36e92ff60c6..9f7e6a15233 100644 --- a/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp +++ b/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp @@ -146,9 +146,6 @@ class LoaderTreeNode : public ResourceObj { LoadedClassInfo* _classes; int _num_classes; - LoadedClassInfo* _anon_classes; - int _num_anon_classes; - LoadedClassInfo* _hidden_classes; int _num_hidden_classes; @@ -224,7 +221,8 @@ class LoaderTreeNode : public ResourceObj { if (print_classes) { if (_classes != NULL) { for (LoadedClassInfo* lci = _classes; lci; lci = lci->_next) { - // non-strong hidden and unsafe anonymous classes should not live in the primary CLD of their loaders. + // non-strong hidden and unsafe anonymous classes should not live in + // the primary CLD of their loaders. assert(lci->_cld == _cld, "must be"); branchtracker.print(st); @@ -253,33 +251,6 @@ class LoaderTreeNode : public ResourceObj { st->cr(); } - if (_anon_classes != NULL) { - for (LoadedClassInfo* lci = _anon_classes; lci; lci = lci->_next) { - branchtracker.print(st); - if (lci == _anon_classes) { // first iteration - st->print("%*s ", indentation, "Unsafe Anonymous Classes:"); - } else { - st->print("%*s ", indentation, ""); - } - st->print("%s", lci->_klass->external_name()); - // For unsafe anonymous classes, also print CLD if verbose. Should - // be a different one than the primary CLD. - assert(lci->_cld != _cld, "must be"); - if (verbose) { - st->print(" (Loader Data: " PTR_FORMAT ")", p2i(lci->_cld)); - } - st->cr(); - } - branchtracker.print(st); - st->print("%*s ", indentation, ""); - st->print_cr("(%u unsafe anonymous class%s)", _num_anon_classes, - (_num_anon_classes == 1) ? "" : "es"); - - // Empty line - branchtracker.print(st); - st->cr(); - } - if (_hidden_classes != NULL) { for (LoadedClassInfo* lci = _hidden_classes; lci; lci = lci->_next) { branchtracker.print(st); @@ -333,9 +304,8 @@ class LoaderTreeNode : public ResourceObj { LoaderTreeNode(const oop loader_oop) : _loader_oop(loader_oop), _cld(NULL), _child(NULL), _next(NULL), - _classes(NULL), _num_classes(0), _anon_classes(NULL), _num_anon_classes(0), - _hidden_classes(NULL), _num_hidden_classes(0), - _num_folded(0) + _classes(NULL), _num_classes(0), _hidden_classes(NULL), + _num_hidden_classes(0), _num_folded(0) {} void set_cld(const ClassLoaderData* cld) { @@ -357,7 +327,7 @@ class LoaderTreeNode : public ResourceObj { LoadedClassInfo** p_list_to_add_to; bool is_hidden = first_class->_klass->is_hidden(); if (has_class_mirror_holder) { - p_list_to_add_to = is_hidden ? &_hidden_classes : &_anon_classes; + p_list_to_add_to = &_hidden_classes; } else { p_list_to_add_to = &_classes; } @@ -367,11 +337,7 @@ class LoaderTreeNode : public ResourceObj { } *p_list_to_add_to = first_class; if (has_class_mirror_holder) { - if (is_hidden) { - _num_hidden_classes += num_classes; - } else { - _num_anon_classes += num_classes; - } + _num_hidden_classes += num_classes; } else { _num_classes += num_classes; } diff --git a/src/hotspot/share/classfile/classLoaderStats.cpp b/src/hotspot/share/classfile/classLoaderStats.cpp index f3adad46da5..27ffd826c5a 100644 --- a/src/hotspot/share/classfile/classLoaderStats.cpp +++ b/src/hotspot/share/classfile/classLoaderStats.cpp @@ -74,18 +74,9 @@ void ClassLoaderStatsClosure::do_cld(ClassLoaderData* cld) { cld->classes_do(&csc); bool is_hidden = false; if(cld->has_class_mirror_holder()) { - // if cld has a class holder then it must be either hidden or unsafe anonymous. - Klass* k = cld->klasses(); - // if it's an array class then need to see if bottom class is hidden. - if (k->is_array_klass()) { - k = ObjArrayKlass::cast(k)->bottom_klass(); - } - is_hidden = k->is_hidden(); - if (is_hidden) { - cls->_hidden_classes_count += csc._num_classes; - } else { - cls->_anon_classes_count += csc._num_classes; - } + // If cld has a class holder then it must be either hidden or unsafe anonymous. + // Either way, count it as a hidden class. + cls->_hidden_classes_count += csc._num_classes; } else { cls->_classes_count = csc._num_classes; } @@ -94,13 +85,8 @@ void ClassLoaderStatsClosure::do_cld(ClassLoaderData* cld) { ClassLoaderMetaspace* ms = cld->metaspace_or_null(); if (ms != NULL) { if(cld->has_class_mirror_holder()) { - if (is_hidden) { - cls->_hidden_chunk_sz += ms->allocated_chunks_bytes(); - cls->_hidden_block_sz += ms->allocated_blocks_bytes(); - } else { - cls->_anon_chunk_sz += ms->allocated_chunks_bytes(); - cls->_anon_block_sz += ms->allocated_blocks_bytes(); - } + cls->_hidden_chunk_sz += ms->allocated_chunks_bytes(); + cls->_hidden_block_sz += ms->allocated_blocks_bytes(); } else { cls->_chunk_sz = ms->allocated_chunks_bytes(); cls->_block_sz = ms->allocated_blocks_bytes(); @@ -133,12 +119,6 @@ bool ClassLoaderStatsClosure::do_entry(oop const& key, ClassLoaderStats* const& _out->print(""); } _out->cr(); - if (cls->_anon_classes_count > 0) { - _out->print_cr(SPACE SPACE SPACE " " UINTX_FORMAT_W(6) " " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(8) " + unsafe anonymous classes", - "", "", "", - cls->_anon_classes_count, - cls->_anon_chunk_sz, cls->_anon_block_sz); - } if (cls->_hidden_classes_count > 0) { _out->print_cr(SPACE SPACE SPACE " " UINTX_FORMAT_W(6) " " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(8) " + hidden classes", "", "", "", diff --git a/src/hotspot/share/classfile/classLoaderStats.hpp b/src/hotspot/share/classfile/classLoaderStats.hpp index c6fac17a8be..f7c27c33d9c 100644 --- a/src/hotspot/share/classfile/classLoaderStats.hpp +++ b/src/hotspot/share/classfile/classLoaderStats.hpp @@ -77,10 +77,6 @@ class ClassLoaderStats : public ResourceObj { size_t _block_sz; uintx _classes_count; - size_t _anon_chunk_sz; - size_t _anon_block_sz; - uintx _anon_classes_count; - size_t _hidden_chunk_sz; size_t _hidden_block_sz; uintx _hidden_classes_count; @@ -92,9 +88,6 @@ class ClassLoaderStats : public ResourceObj { _chunk_sz(0), _block_sz(0), _classes_count(0), - _anon_chunk_sz(0), - _anon_block_sz(0), - _anon_classes_count(0), _hidden_chunk_sz(0), _hidden_block_sz(0), _hidden_classes_count(0) { diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp index 5b86621fc8f..f5078157e4e 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.cpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp @@ -480,37 +480,6 @@ void SystemDictionaryShared::define_shared_package(Symbol* class_name, } } -// Define Package for shared app/platform classes from named module -void SystemDictionaryShared::define_shared_package(Symbol* class_name, - Handle class_loader, - ModuleEntry* mod_entry, - TRAPS) { - assert(mod_entry != NULL, "module_entry should not be NULL"); - Handle module_handle(THREAD, mod_entry->module()); - - Handle pkg_name = get_package_name(class_name, CHECK); - assert(pkg_name.not_null(), "Package should not be null for class in named module"); - - Klass* classLoader_klass; - if (SystemDictionary::is_system_class_loader(class_loader())) { - classLoader_klass = SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass(); - } else { - assert(SystemDictionary::is_platform_class_loader(class_loader()), "unexpected classloader"); - classLoader_klass = SystemDictionary::jdk_internal_loader_ClassLoaders_PlatformClassLoader_klass(); - } - - JavaValue result(T_OBJECT); - JavaCallArguments args(2); - args.set_receiver(class_loader); - args.push_oop(pkg_name); - args.push_oop(module_handle); - JavaCalls::call_virtual(&result, classLoader_klass, - vmSymbols::definePackage_name(), - vmSymbols::definePackage_signature(), - &args, - CHECK); -} - // Get the ProtectionDomain associated with the CodeSource from the classloader. Handle SystemDictionaryShared::get_protection_domain_from_classloader(Handle class_loader, Handle url, TRAPS) { @@ -599,11 +568,11 @@ Handle SystemDictionaryShared::init_security_info(Handle class_loader, InstanceK // For shared app/platform classes originated from the run-time image: // The ProtectionDomains are cached in the corresponding ModuleEntries // for fast access by the VM. - if (pkg_entry != NULL) { - ModuleEntry* mod_entry = pkg_entry->module(); - pd = get_shared_protection_domain(class_loader, mod_entry, THREAD); - define_shared_package(class_name, class_loader, mod_entry, CHECK_(pd)); - } + // all packages from module image are already created during VM bootstrap in + // Modules::define_module(). + assert(pkg_entry != NULL, "archived class in module image cannot be from unnamed package"); + ModuleEntry* mod_entry = pkg_entry->module(); + pd = get_shared_protection_domain(class_loader, mod_entry, THREAD); } else { // For shared app/platform classes originated from JAR files on the class path: // Each of the 3 SystemDictionaryShared::_shared_xxx arrays has the same length diff --git a/src/hotspot/share/classfile/systemDictionaryShared.hpp b/src/hotspot/share/classfile/systemDictionaryShared.hpp index 86cc9f76b9b..bd0b43d1983 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.hpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.hpp @@ -167,10 +167,6 @@ class SystemDictionaryShared: public SystemDictionary { Handle manifest, Handle url, TRAPS); - static void define_shared_package(Symbol* class_name, - Handle class_loader, - ModuleEntry* mod_entry, - TRAPS); static Handle get_shared_jar_manifest(int shared_path_index, TRAPS); static Handle get_shared_jar_url(int shared_path_index, TRAPS); diff --git a/src/hotspot/share/classfile/vmSymbols.hpp b/src/hotspot/share/classfile/vmSymbols.hpp index 94c632cf7d0..093dc95a8e4 100644 --- a/src/hotspot/share/classfile/vmSymbols.hpp +++ b/src/hotspot/share/classfile/vmSymbols.hpp @@ -436,8 +436,6 @@ template(input_stream_signature, "Ljava/io/InputStream;") \ template(print_stream_signature, "Ljava/io/PrintStream;") \ template(security_manager_signature, "Ljava/lang/SecurityManager;") \ - template(definePackage_name, "definePackage") \ - template(definePackage_signature, "(Ljava/lang/String;Ljava/lang/Module;)Ljava/lang/Package;") \ template(defineOrCheckPackage_name, "defineOrCheckPackage") \ template(defineOrCheckPackage_signature, "(Ljava/lang/String;Ljava/util/jar/Manifest;Ljava/net/URL;)Ljava/lang/Package;") \ template(fileToEncodedURL_name, "fileToEncodedURL") \ diff --git a/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp b/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp index cce25c6ab0c..39421ad5267 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentMark.hpp @@ -65,22 +65,13 @@ class G1TaskQueueEntry { } G1TaskQueueEntry(HeapWord* addr) : _holder((void*)((uintptr_t)addr | ArraySliceBit)) { } public: - G1TaskQueueEntry(const G1TaskQueueEntry& other) { _holder = other._holder; } + G1TaskQueueEntry() : _holder(NULL) { } + // Trivially copyable, for use in GenericTaskQueue. static G1TaskQueueEntry from_slice(HeapWord* what) { return G1TaskQueueEntry(what); } static G1TaskQueueEntry from_oop(oop obj) { return G1TaskQueueEntry(obj); } - G1TaskQueueEntry& operator=(const G1TaskQueueEntry& t) { - _holder = t._holder; - return *this; - } - - volatile G1TaskQueueEntry& operator=(const volatile G1TaskQueueEntry& t) volatile { - _holder = t._holder; - return *this; - } - oop obj() const { assert(!is_array_slice(), "Trying to read array slice " PTR_FORMAT " as oop", p2i(_holder)); return (oop)_holder; diff --git a/src/hotspot/share/gc/g1/g1NUMAStats.cpp b/src/hotspot/share/gc/g1/g1NUMAStats.cpp index 03bc28b4e5d..ab05cd5f2a8 100644 --- a/src/hotspot/share/gc/g1/g1NUMAStats.cpp +++ b/src/hotspot/share/gc/g1/g1NUMAStats.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,8 @@ double G1NUMAStats::Stat::rate() const { } G1NUMAStats::NodeDataArray::NodeDataArray(uint num_nodes) { - guarantee(num_nodes > 1, "Number of nodes (%u) should be set", num_nodes); + // Not using > 1, for -XX:+ForceNUMA support. + guarantee(num_nodes > 0, "Number of nodes (%u) should be set", num_nodes); // The row represents the number of nodes. _num_column = num_nodes; @@ -124,7 +125,8 @@ void G1NUMAStats::NodeDataArray::copy(uint req_index, size_t* stat) { G1NUMAStats::G1NUMAStats(const int* node_ids, uint num_node_ids) : _node_ids(node_ids), _num_node_ids(num_node_ids), _node_data() { - assert(_num_node_ids > 1, "Should have more than one active memory nodes %u", _num_node_ids); + // Not using > 1, for -XX:+ForceNUMA support. + assert(_num_node_ids > 0, "Should have at least one node id: %u", _num_node_ids); for (int i = 0; i < NodeDataItemsSentinel; i++) { _node_data[i] = new NodeDataArray(_num_node_ids); diff --git a/src/hotspot/share/gc/g1/heapRegionManager.cpp b/src/hotspot/share/gc/g1/heapRegionManager.cpp index f3e8de03ab2..f37a51f2f18 100644 --- a/src/hotspot/share/gc/g1/heapRegionManager.cpp +++ b/src/hotspot/share/gc/g1/heapRegionManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,6 +59,10 @@ class MasterFreeRegionListChecker : public HeapRegionSetChecker { const char* get_description() { return "Free Regions"; } }; +HeapRegionRange::HeapRegionRange(uint start, uint end) : _start(start), _end(end) { + assert(start <= end, "Invariant"); +} + HeapRegionManager::HeapRegionManager() : _bot_mapper(NULL), _cardtable_mapper(NULL), @@ -282,19 +286,21 @@ uint HeapRegionManager::expand_at(uint start, uint num_regions, WorkGang* pretou return 0; } - uint cur = start; - uint idx_last_found = 0; - uint num_last_found = 0; - + uint offset = start; uint expanded = 0; - while (expanded < num_regions && - (num_last_found = find_unavailable_from_idx(cur, &idx_last_found)) > 0) { - uint to_expand = MIN2(num_regions - expanded, num_last_found); - make_regions_available(idx_last_found, to_expand, pretouch_workers); + do { + HeapRegionRange regions = find_unavailable_from_idx(offset); + if (regions.length() == 0) { + // No more unavailable regions. + break; + } + + uint to_expand = MIN2(num_regions - expanded, regions.length()); + make_regions_available(regions.start(), to_expand, pretouch_workers); expanded += to_expand; - cur = idx_last_found + num_last_found + 1; - } + offset = regions.end(); + } while (expanded < num_regions); verify_optional(); return expanded; @@ -429,32 +435,24 @@ void HeapRegionManager::iterate(HeapRegionClosure* blk) const { } } -uint HeapRegionManager::find_unavailable_from_idx(uint start_idx, uint* res_idx) const { - guarantee(res_idx != NULL, "checking"); - guarantee(start_idx <= (max_length() + 1), "checking"); - - uint num_regions = 0; +HeapRegionRange HeapRegionManager::find_unavailable_from_idx(uint index) const { + guarantee(index <= max_length(), "checking"); - uint cur = start_idx; - while (cur < max_length() && is_available(cur)) { - cur++; - } - if (cur == max_length()) { - return num_regions; - } - *res_idx = cur; - while (cur < max_length() && !is_available(cur)) { - cur++; - } - num_regions = cur - *res_idx; -#ifdef ASSERT - for (uint i = *res_idx; i < (*res_idx + num_regions); i++) { - assert(!is_available(i), "just checking"); + // Find first unavailable region from offset. + BitMap::idx_t start = _available_map.get_next_zero_offset(index); + if (start == _available_map.size()) { + // No unavailable regions found. + return HeapRegionRange(max_length(), max_length()); } - assert(cur == max_length() || num_regions == 0 || is_available(cur), - "The region at the current position %u must be available or at the end of the heap.", cur); -#endif - return num_regions; + + // The end of the range is the next available region. + BitMap::idx_t end = _available_map.get_next_one_offset(start); + + assert(!_available_map.at(start), "Found region (" SIZE_FORMAT ") is not unavailable", start); + assert(!_available_map.at(end - 1), "Last region (" SIZE_FORMAT ") in range is not unavailable", end - 1); + assert(end == _available_map.size() || _available_map.at(end), "Region (" SIZE_FORMAT ") is not available", end); + + return HeapRegionRange((uint) start, (uint) end); } uint HeapRegionManager::find_highest_free(bool* expanded) { diff --git a/src/hotspot/share/gc/g1/heapRegionManager.hpp b/src/hotspot/share/gc/g1/heapRegionManager.hpp index 010f3865b19..4aad234dda1 100644 --- a/src/hotspot/share/gc/g1/heapRegionManager.hpp +++ b/src/hotspot/share/gc/g1/heapRegionManager.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "gc/g1/g1BiasedArray.hpp" #include "gc/g1/g1RegionToSpaceMapper.hpp" #include "gc/g1/heapRegionSet.hpp" +#include "memory/allocation.hpp" #include "services/memoryUsage.hpp" class HeapRegion; @@ -41,6 +42,20 @@ class G1HeapRegionTable : public G1BiasedMappedArray { virtual HeapRegion* default_value() const { return NULL; } }; +// Helper class to define a range [start, end) of regions. +class HeapRegionRange : public StackObj { + // Inclusive start of the range. + uint _start; + // Exclusive end of the range. + uint _end; + public: + HeapRegionRange(uint start, uint end); + + uint start() const { return _start; } + uint end() const { return _end; } + uint length() const { return _end - _start; } +}; + // This class keeps track of the actual heap memory, auxiliary data // and its metadata (i.e., HeapRegion instances) and the list of free regions. // @@ -107,10 +122,10 @@ class HeapRegionManager: public CHeapObj { void assert_contiguous_range(uint start, uint num_regions) NOT_DEBUG_RETURN; - // Finds the next sequence of unavailable regions starting from start_idx. Returns the - // length of the sequence found. If this result is zero, no such sequence could be found, - // otherwise res_idx indicates the start index of these regions. - uint find_unavailable_from_idx(uint start_idx, uint* res_idx) const; + // Finds the next sequence of unavailable regions starting at the given index. Returns the + // sequence found as a HeapRegionRange. If no regions can be found, both start and end of + // the returned range is equal to max_regions(). + HeapRegionRange find_unavailable_from_idx(uint index) const; // Finds the next sequence of empty regions starting from start_idx, going backwards in // the heap. Returns the length of the sequence found. If this value is zero, no // sequence could be found, otherwise res_idx contains the start index of this range. diff --git a/src/hotspot/share/gc/shared/barrierSetNMethod.cpp b/src/hotspot/share/gc/shared/barrierSetNMethod.cpp index 86acd37bfcf..9c6ba3867f1 100644 --- a/src/hotspot/share/gc/shared/barrierSetNMethod.cpp +++ b/src/hotspot/share/gc/shared/barrierSetNMethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,6 +62,16 @@ int BarrierSetNMethod::nmethod_stub_entry_barrier(address* return_address_ptr) { assert(!nm->is_osr_method(), "Should not reach here"); // Called upon first entry after being armed bool may_enter = bs_nm->nmethod_entry_barrier(nm); + + // Diagnostic option to force deoptimization 1 in 3 times. It is otherwise + // a very rare event. + if (DeoptimizeNMethodBarriersALot) { + static volatile uint32_t counter=0; + if (Atomic::add(&counter, 1u) % 3 == 0) { + may_enter = false; + } + } + if (!may_enter) { log_trace(nmethod, barrier)("Deoptimizing nmethod: " PTR_FORMAT, p2i(nm)); bs_nm->deoptimize(nm, return_address_ptr); diff --git a/src/hotspot/share/gc/shared/taskqueue.hpp b/src/hotspot/share/gc/shared/taskqueue.hpp index 9c9be36a167..876138dfcbc 100644 --- a/src/hotspot/share/gc/shared/taskqueue.hpp +++ b/src/hotspot/share/gc/shared/taskqueue.hpp @@ -28,6 +28,8 @@ #include "memory/allocation.hpp" #include "memory/padded.hpp" #include "oops/oopsHierarchy.hpp" +#include "runtime/atomic.hpp" +#include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/ostream.hpp" #include "utilities/stack.hpp" @@ -107,31 +109,23 @@ class TaskQueueSuper: public CHeapObj { protected: // Internal type for indexing the queue; also used for the tag. typedef NOT_LP64(uint16_t) LP64_ONLY(uint32_t) idx_t; + STATIC_ASSERT(N == idx_t(N)); // Ensure N fits in an idx_t. - // The first free element after the last one pushed (mod N). - volatile uint _bottom; - - enum { MOD_N_MASK = N - 1 }; + // N must be a power of 2 for computing modulo via masking. + // N must be >= 2 for the algorithm to work at all, though larger is better. + // C++11: is_power_of_2 is not (yet) constexpr. + STATIC_ASSERT((N >= 2) && ((N & (N - 1)) == 0)); + static const uint MOD_N_MASK = N - 1; class Age { - public: - Age(size_t data = 0) { _data = data; } - Age(const Age& age) { _data = age._data; } - Age(idx_t top, idx_t tag) { _fields._top = top; _fields._tag = tag; } - - Age get() const volatile { return _data; } - void set(Age age) volatile { _data = age._data; } + friend class TaskQueueSuper; - idx_t top() const volatile { return _fields._top; } - idx_t tag() const volatile { return _fields._tag; } - - // Increment top; if it wraps, increment tag also. - void increment() { - _fields._top = increment_index(_fields._top); - if (_fields._top == 0) ++_fields._tag; - } + public: + explicit Age(size_t data = 0) : _data(data) {} + Age(idx_t top, idx_t tag) { _fields._top = top; _fields._tag = tag; } - Age cmpxchg(const Age new_age, const Age old_age) volatile; + idx_t top() const { return _fields._top; } + idx_t tag() const { return _fields._tag; } bool operator ==(const Age& other) const { return _data == other._data; } @@ -144,9 +138,41 @@ class TaskQueueSuper: public CHeapObj { size_t _data; fields _fields; }; + STATIC_ASSERT(sizeof(size_t) >= sizeof(fields)); }; - volatile Age _age; + uint bottom_relaxed() const { + return Atomic::load(&_bottom); + } + + uint bottom_acquire() const { + return Atomic::load_acquire(&_bottom); + } + + void set_bottom_relaxed(uint new_bottom) { + Atomic::store(&_bottom, new_bottom); + } + + void release_set_bottom(uint new_bottom) { + Atomic::release_store(&_bottom, new_bottom); + } + + Age age_relaxed() const { + return Age(Atomic::load(&_age._data)); + } + + void set_age_relaxed(Age new_age) { + Atomic::store(&_age._data, new_age._data); + } + + Age cmpxchg_age(Age old_age, Age new_age) { + return Age(Atomic::cmpxchg(&_age._data, old_age._data, new_age._data)); + } + + idx_t age_top_relaxed() const { + // Atomically accessing a subfield of an "atomic" member. + return Atomic::load(&_age._fields._top); + } // These both operate mod N. static uint increment_index(uint ind) { @@ -163,7 +189,7 @@ class TaskQueueSuper: public CHeapObj { } // Returns the size corresponding to the given "bot" and "top". - uint size(uint bot, uint top) const { + uint clean_size(uint bot, uint top) const { uint sz = dirty_size(bot, top); // Has the queue "wrapped", so that bottom is less than top? There's a // complicated special case here. A pair of threads could perform pop_local @@ -182,27 +208,46 @@ class TaskQueueSuper: public CHeapObj { return (sz == N - 1) ? 0 : sz; } +private: + DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0); + + // Index of the first free element after the last one pushed (mod N). + volatile uint _bottom; + DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(uint)); + + // top() is the index of the oldest pushed element (mod N), and tag() + // is the associated epoch, to distinguish different modifications of + // the age. There is no available element if top() == _bottom or + // (_bottom - top()) mod N == N-1; the latter indicates underflow + // during concurrent pop_local/pop_global. + volatile Age _age; + DEFINE_PAD_MINUS_SIZE(2, DEFAULT_CACHE_LINE_SIZE, sizeof(Age)); + + NONCOPYABLE(TaskQueueSuper); + public: TaskQueueSuper() : _bottom(0), _age() {} - // Return true if the TaskQueue contains/does not contain any tasks. - bool peek() const { return _bottom != _age.top(); } - bool is_empty() const { return size() == 0; } + // Return true if the TaskQueue contains any tasks. + // Unreliable if there are concurrent pushes or pops. + bool peek() const { + return bottom_relaxed() != age_top_relaxed(); + } - // Return an estimate of the number of elements in the queue. - // The "careful" version admits the possibility of pop_local/pop_global - // races. - uint size() const { - return size(_bottom, _age.top()); + bool is_empty() const { + return size() == 0; } - uint dirty_size() const { - return dirty_size(_bottom, _age.top()); + // Return an estimate of the number of elements in the queue. + // Treats pop_local/pop_global race that underflows as empty. + uint size() const { + return clean_size(bottom_relaxed(), age_top_relaxed()); } + // Discard the contents of the queue. void set_empty() { - _bottom = 0; - _age.set(0); + set_bottom_relaxed(0); + set_age_relaxed(Age()); } // Maximum number of elements allowed in the queue. This is two less @@ -211,9 +256,6 @@ class TaskQueueSuper: public CHeapObj { // in GenericTaskQueue. uint max_elems() const { return N - 2; } - // Total size of queue. - static const uint total_size() { return N; } - TASKQUEUE_STATS_ONLY(TaskQueueStats stats;) }; @@ -254,11 +296,23 @@ class GenericTaskQueue: public TaskQueueSuper { typedef typename TaskQueueSuper::Age Age; typedef typename TaskQueueSuper::idx_t idx_t; - using TaskQueueSuper::_bottom; - using TaskQueueSuper::_age; + using TaskQueueSuper::MOD_N_MASK; + + using TaskQueueSuper::bottom_relaxed; + using TaskQueueSuper::bottom_acquire; + + using TaskQueueSuper::set_bottom_relaxed; + using TaskQueueSuper::release_set_bottom; + + using TaskQueueSuper::age_relaxed; + using TaskQueueSuper::set_age_relaxed; + using TaskQueueSuper::cmpxchg_age; + using TaskQueueSuper::age_top_relaxed; + using TaskQueueSuper::increment_index; using TaskQueueSuper::decrement_index; using TaskQueueSuper::dirty_size; + using TaskQueueSuper::clean_size; public: using TaskQueueSuper::max_elems; @@ -285,13 +339,14 @@ class GenericTaskQueue: public TaskQueueSuper { // Attempts to claim a task from the "local" end of the queue (the most // recently pushed) as long as the number of entries exceeds the threshold. - // If successful, returns true and sets t to the task; otherwise, returns false - // (the queue is empty or the number of elements below the threshold). - inline bool pop_local(volatile E& t, uint threshold = 0); + // If successfully claims a task, returns true and sets t to the task; + // otherwise, returns false and t is unspecified. May fail and return + // false because of a successful steal by pop_global. + inline bool pop_local(E& t, uint threshold = 0); // Like pop_local(), but uses the "global" end of the queue (the least // recently pushed). - bool pop_global(volatile E& t); + bool pop_global(E& t); // Delete any resource associated with the queue. ~GenericTaskQueue(); @@ -301,9 +356,10 @@ class GenericTaskQueue: public TaskQueueSuper { template void iterate(Fn fn); private: - DEFINE_PAD_MINUS_SIZE(0, DEFAULT_CACHE_LINE_SIZE, 0); + // Base class has trailing padding. + // Element array. - volatile E* _elems; + E* _elems; DEFINE_PAD_MINUS_SIZE(1, DEFAULT_CACHE_LINE_SIZE, sizeof(E*)); // Queue owner local variables. Not to be accessed by other threads. @@ -444,12 +500,6 @@ class TerminatorTerminator: public CHeapObj { virtual bool should_exit_termination() = 0; }; -#ifdef _MSC_VER -#pragma warning(push) -// warning C4522: multiple assignment operators specified -#pragma warning(disable:4522) -#endif - // This is a container class for either an oop* or a narrowOop*. // Both are pushed onto a task queue and the consumer will test is_narrow() // to determine which should be processed. @@ -468,20 +518,13 @@ class StarTask { _holder = (void*)p; } StarTask() { _holder = NULL; } + // Trivially copyable, for use in GenericTaskQueue. + operator oop*() { return (oop*)_holder; } operator narrowOop*() { return (narrowOop*)((uintptr_t)_holder & ~COMPRESSED_OOP_MASK); } - StarTask& operator=(const StarTask& t) { - _holder = t._holder; - return *this; - } - volatile StarTask& operator=(const volatile StarTask& t) volatile { - _holder = t._holder; - return *this; - } - bool is_narrow() const { return (((uintptr_t)_holder & COMPRESSED_OOP_MASK) != 0); } @@ -494,19 +537,7 @@ class ObjArrayTask ObjArrayTask(oop o, size_t idx): _obj(o), _index(int(idx)) { assert(idx <= size_t(max_jint), "too big"); } - ObjArrayTask(const ObjArrayTask& t): _obj(t._obj), _index(t._index) { } - - ObjArrayTask& operator =(const ObjArrayTask& t) { - _obj = t._obj; - _index = t._index; - return *this; - } - volatile ObjArrayTask& - operator =(const volatile ObjArrayTask& t) volatile { - (void)const_cast(_obj = t._obj); - _index = t._index; - return *this; - } + // Trivially copyable, for use in GenericTaskQueue. inline oop obj() const { return _obj; } inline int index() const { return _index; } @@ -518,8 +549,4 @@ class ObjArrayTask int _index; }; -#ifdef _MSC_VER -#pragma warning(pop) -#endif - #endif // SHARE_GC_SHARED_TASKQUEUE_HPP diff --git a/src/hotspot/share/gc/shared/taskqueue.inline.hpp b/src/hotspot/share/gc/shared/taskqueue.inline.hpp index 54723685c5c..395b68cd65d 100644 --- a/src/hotspot/share/gc/shared/taskqueue.inline.hpp +++ b/src/hotspot/share/gc/shared/taskqueue.inline.hpp @@ -54,14 +54,14 @@ inline void GenericTaskQueue::initialize() { template inline GenericTaskQueue::~GenericTaskQueue() { - ArrayAllocator::free(const_cast(_elems), N); + ArrayAllocator::free(_elems, N); } template inline bool GenericTaskQueue::push(E t) { - uint localBot = _bottom; + uint localBot = bottom_relaxed(); assert(localBot < N, "_bottom out of range."); - idx_t top = _age.top(); + idx_t top = age_top_relaxed(); uint dirty_n_elems = dirty_size(localBot, top); // A dirty_size of N-1 cannot happen in push. Considering only push: // (1) dirty_n_elems is initially 0. @@ -75,13 +75,8 @@ GenericTaskQueue::push(E t) { // so can't underflow to -1 (== N-1) with push. assert(dirty_n_elems <= max_elems(), "n_elems out of range."); if (dirty_n_elems < max_elems()) { - // g++ complains if the volatile result of the assignment is - // unused, so we cast the volatile away. We cannot cast directly - // to void, because gcc treats that as not using the result of the - // assignment. However, casting to E& means that we trigger an - // unused-value warning. So, we cast the E& to void. - (void) const_cast(_elems[localBot] = t); - Atomic::release_store(&_bottom, increment_index(localBot)); + _elems[localBot] = t; + release_set_bottom(increment_index(localBot)); TASKQUEUE_STATS_ONLY(stats.record_push()); return true; } @@ -89,8 +84,7 @@ GenericTaskQueue::push(E t) { } template -inline bool OverflowTaskQueue::push(E t) -{ +inline bool OverflowTaskQueue::push(E t) { if (!taskqueue_t::push(t)) { overflow_stack()->push(t); TASKQUEUE_STATS_ONLY(stats.record_overflow(overflow_stack()->size())); @@ -114,61 +108,56 @@ bool GenericTaskQueue::pop_local_slow(uint localBot, Age oldAge) { // This queue was observed to contain exactly one element; either this // thread will claim it, or a competing "pop_global". In either case, // the queue will be logically empty afterwards. Create a new Age value - // that represents the empty queue for the given value of "_bottom". (We + // that represents the empty queue for the given value of "bottom". (We // must also increment "tag" because of the case where "bottom == 1", // "top == 0". A pop_global could read the queue element in that case, // then have the owner thread do a pop followed by another push. Without // the incrementing of "tag", the pop_global's CAS could succeed, // allowing it to believe it has claimed the stale element.) - Age newAge((idx_t)localBot, oldAge.tag() + 1); + Age newAge((idx_t)localBot, (idx_t)(oldAge.tag() + 1)); // Perhaps a competing pop_global has already incremented "top", in which // case it wins the element. if (localBot == oldAge.top()) { // No competing pop_global has yet incremented "top"; we'll try to // install new_age, thus claiming the element. - Age tempAge = _age.cmpxchg(newAge, oldAge); + Age tempAge = cmpxchg_age(oldAge, newAge); if (tempAge == oldAge) { // We win. - assert(dirty_size(localBot, _age.top()) != N - 1, "sanity"); + assert(dirty_size(localBot, age_top_relaxed()) != N - 1, "sanity"); TASKQUEUE_STATS_ONLY(stats.record_pop_slow()); return true; } } - // We lose; a completing pop_global gets the element. But the queue is empty + // We lose; a competing pop_global got the element. But the queue is empty // and top is greater than bottom. Fix this representation of the empty queue // to become the canonical one. - _age.set(newAge); - assert(dirty_size(localBot, _age.top()) != N - 1, "sanity"); + set_age_relaxed(newAge); + assert(dirty_size(localBot, age_top_relaxed()) != N - 1, "sanity"); return false; } template inline bool -GenericTaskQueue::pop_local(volatile E& t, uint threshold) { - uint localBot = _bottom; +GenericTaskQueue::pop_local(E& t, uint threshold) { + uint localBot = bottom_relaxed(); // This value cannot be N-1. That can only occur as a result of // the assignment to bottom in this method. If it does, this method // resets the size to 0 before the next call (which is sequential, // since this is pop_local.) - uint dirty_n_elems = dirty_size(localBot, _age.top()); + uint dirty_n_elems = dirty_size(localBot, age_top_relaxed()); assert(dirty_n_elems != N - 1, "Shouldn't be possible..."); if (dirty_n_elems <= threshold) return false; localBot = decrement_index(localBot); - _bottom = localBot; + set_bottom_relaxed(localBot); // This is necessary to prevent any read below from being reordered // before the store just above. OrderAccess::fence(); - // g++ complains if the volatile result of the assignment is - // unused, so we cast the volatile away. We cannot cast directly - // to void, because gcc treats that as not using the result of the - // assignment. However, casting to E& means that we trigger an - // unused-value warning. So, we cast the E& to void. - (void) const_cast(t = _elems[localBot]); + t = _elems[localBot]; // This is a second read of "age"; the "size()" above is the first. // If there's still at least one element in the queue, based on the // "_bottom" and "age" we've read, then there can be no interference with // a "pop_global" operation, and we're done. - idx_t tp = _age.top(); // XXX - if (size(localBot, tp) > 0) { + idx_t tp = age_top_relaxed(); + if (clean_size(localBot, tp) > 0) { assert(dirty_size(localBot, tp) != N - 1, "sanity"); TASKQUEUE_STATS_ONLY(stats.record_pop()); return true; @@ -176,11 +165,11 @@ GenericTaskQueue::pop_local(volatile E& t, uint threshold) { // Otherwise, the queue contained exactly one element; we take the slow // path. - // The barrier is required to prevent reordering the two reads of _age: - // one is the _age.get() below, and the other is _age.top() above the if-stmt. - // The algorithm may fail if _age.get() reads an older value than _age.top(). + // The barrier is required to prevent reordering the two reads of age: + // one is the age() below, and the other is age_top() above the if-stmt. + // The algorithm may fail if age() reads an older value than age_top(). OrderAccess::loadload(); - return pop_local_slow(localBot, _age.get()); + return pop_local_slow(localBot, age_relaxed()); } } @@ -192,9 +181,30 @@ bool OverflowTaskQueue::pop_overflow(E& t) return true; } +// A pop_global operation may read an element that is being concurrently +// written by a push operation. The pop_global operation will not use +// such an element, returning failure instead. But the concurrent read +// and write places requirements on the element type. +// +// Strictly, such concurrent reads and writes are undefined behavior. +// We ignore that. Instead we require that whatever value tearing may +// occur as a result is benign. A trivially copyable type (C++14 3.9/9) +// satisfies the requirement. But we might use classes such as oop that +// are not trivially copyable (in some build configurations). Such +// classes need to be carefully examined with this requirement in mind. +// +// The sequence where such a read/write collision can arise is as follows. +// Assume there is one value in the queue, so bottom == top+1. +// (1) Thief is doing a pop_global. It has read age and bottom, and its +// captured (localBottom - oldAge.top) == 1. +// (2) Owner does a pop_local and wins the race for that element. It +// decrements bottom and increments the age tag. +// (3) Owner starts a push, writing elems[bottom]. At the same time, Thief +// reads elems[oldAge.top]. The owner's bottom == the thief's oldAge.top. +// (4) Thief will discard the read value, because its cmpxchg of age will fail. template -bool GenericTaskQueue::pop_global(volatile E& t) { - Age oldAge = _age.get(); +bool GenericTaskQueue::pop_global(E& t) { + Age oldAge = age_relaxed(); #ifndef CPU_MULTI_COPY_ATOMIC // Architectures with non-multi-copy-atomic memory model require a // full fence here to guarantee that bottom is not older than age, @@ -212,26 +222,24 @@ bool GenericTaskQueue::pop_global(volatile E& t) { OrderAccess::fence(); #else // Everyone else can make do with a LoadLoad barrier to keep reads - // from _age and _bottom in order. + // from age and bottom in order. OrderAccess::loadload(); #endif - uint localBot = Atomic::load_acquire(&_bottom); - uint n_elems = size(localBot, oldAge.top()); + uint localBot = bottom_acquire(); + uint n_elems = clean_size(localBot, oldAge.top()); if (n_elems == 0) { return false; } - // g++ complains if the volatile result of the assignment is - // unused, so we cast the volatile away. We cannot cast directly - // to void, because gcc treats that as not using the result of the - // assignment. However, casting to E& means that we trigger an - // unused-value warning. So, we cast the E& to void. - (void) const_cast(t = _elems[oldAge.top()]); - Age newAge(oldAge); - newAge.increment(); - Age resAge = _age.cmpxchg(newAge, oldAge); + t = _elems[oldAge.top()]; + // Increment top; if it wraps, also increment tag, to distinguish it + // from any recent _age for the same top() index. + idx_t new_top = increment_index(oldAge.top()); + idx_t new_tag = oldAge.tag() + ((new_top == 0) ? 1 : 0); + Age newAge(new_top, new_tag); + Age resAge = cmpxchg_age(oldAge, newAge); - // Note that using "_bottom" here might fail, since a pop_local might + // Note that using "bottom" here might fail, since a pop_local might // have decremented it. assert(dirty_size(localBot, newAge.top()) != N - 1, "sanity"); return resAge == oldAge; @@ -324,19 +332,14 @@ GenericTaskQueueSet::steal(uint queue_num, E& t) { return false; } -template -inline typename TaskQueueSuper::Age TaskQueueSuper::Age::cmpxchg(const Age new_age, const Age old_age) volatile { - return Atomic::cmpxchg(&_data, old_age._data, new_age._data); -} - template template inline void GenericTaskQueue::iterate(Fn fn) { uint iters = size(); - uint index = _bottom; + uint index = bottom_relaxed(); for (uint i = 0; i < iters; ++i) { index = decrement_index(index); - fn(const_cast(_elems[index])); // cast away volatility + fn(_elems[index]); } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp index 486594a6d4a..071b72a990b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp @@ -346,7 +346,7 @@ class ShenandoahUpdateThreadRootsTask : public AbstractGangTask { public: ShenandoahUpdateThreadRootsTask(bool is_par, ShenandoahPhaseTimings::Phase phase) : AbstractGangTask("Shenandoah Update Thread Roots"), - _thread_roots(is_par), + _thread_roots(phase, is_par), _phase(phase), _worker_phase(phase) {} diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp index b4c9c8a32c1..c33f881ace8 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentRoots.cpp @@ -37,7 +37,7 @@ bool ShenandoahConcurrentRoots::should_do_concurrent_roots() { } bool ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() { -#if defined(X86) && !defined(SOLARIS) +#if (defined(X86) || defined(AARCH64)) && !defined(SOLARIS) return ShenandoahCodeRootsStyle == 2 && ClassUnloading; #else diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index 78f4ffe430e..2f118317dc1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -372,7 +372,7 @@ jint ShenandoahHeap::initialize() { } _monitoring_support = new ShenandoahMonitoringSupport(this); - _phase_timings = new ShenandoahPhaseTimings(); + _phase_timings = new ShenandoahPhaseTimings(max_workers()); ShenandoahStringDedup::initialize(); ShenandoahCodeRoots::initialize(); @@ -1645,9 +1645,10 @@ class ShenandoahConcurrentRootsEvacUpdateTask : public AbstractGangTask { ShenandoahConcurrentStringDedupRoots _dedup_roots; public: - ShenandoahConcurrentRootsEvacUpdateTask() : - AbstractGangTask("Shenandoah Evacuate/Update Concurrent Strong Roots Task") { - } + ShenandoahConcurrentRootsEvacUpdateTask(ShenandoahPhaseTimings::Phase phase) : + AbstractGangTask("Shenandoah Evacuate/Update Concurrent Strong Roots Task"), + _vm_roots(phase), + _cld_roots(phase) {} void work(uint worker_id) { ShenandoahEvacOOMScope oom; @@ -1761,12 +1762,13 @@ class ShenandoahConcurrentWeakRootsEvacUpdateTask : public AbstractGangTask { bool _concurrent_class_unloading; public: - ShenandoahConcurrentWeakRootsEvacUpdateTask() : + ShenandoahConcurrentWeakRootsEvacUpdateTask(ShenandoahPhaseTimings::Phase phase) : AbstractGangTask("Shenandoah Concurrent Weak Root Task"), - _jni_roots(OopStorageSet::jni_weak(), ShenandoahPhaseTimings::JNIWeakRoots), - _string_table_roots(OopStorageSet::string_table_weak(), ShenandoahPhaseTimings::StringTableRoots), - _resolved_method_table_roots(OopStorageSet::resolved_method_table_weak(), ShenandoahPhaseTimings::ResolvedMethodTableRoots), - _vm_roots(OopStorageSet::vm_weak(), ShenandoahPhaseTimings::VMWeakRoots), + _jni_roots(OopStorageSet::jni_weak(), phase, ShenandoahPhaseTimings::JNIWeakRoots), + _string_table_roots(OopStorageSet::string_table_weak(), phase, ShenandoahPhaseTimings::StringTableRoots), + _resolved_method_table_roots(OopStorageSet::resolved_method_table_weak(), phase, ShenandoahPhaseTimings::ResolvedMethodTableRoots), + _vm_roots(OopStorageSet::vm_weak(), phase, ShenandoahPhaseTimings::VMWeakRoots), + _cld_roots(phase), _nmethod_itr(ShenandoahCodeRoots::table()), _concurrent_class_unloading(ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) { StringTable::reset_dead_counter(); @@ -1826,7 +1828,7 @@ class ShenandoahConcurrentWeakRootsEvacUpdateTask : public AbstractGangTask { void ShenandoahHeap::op_weak_roots() { if (is_concurrent_weak_root_in_progress()) { // Concurrent weak root processing - ShenandoahConcurrentWeakRootsEvacUpdateTask task; + ShenandoahConcurrentWeakRootsEvacUpdateTask task(ShenandoahPhaseTimings::conc_weak_roots); workers()->run_task(&task); if (!ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) { set_concurrent_weak_root_in_progress(false); @@ -1844,7 +1846,7 @@ void ShenandoahHeap::op_class_unloading() { void ShenandoahHeap::op_strong_roots() { assert(is_concurrent_strong_root_in_progress(), "Checked by caller"); - ShenandoahConcurrentRootsEvacUpdateTask task; + ShenandoahConcurrentRootsEvacUpdateTask task(ShenandoahPhaseTimings::conc_strong_roots); workers()->run_task(&task); set_concurrent_strong_root_in_progress(false); } @@ -2243,17 +2245,17 @@ void ShenandoahHeap::stw_process_weak_roots(bool full_gc) { ShenandoahForwardedIsAliveClosure is_alive; ShenandoahUpdateRefsClosure keep_alive; ShenandoahParallelWeakRootsCleaningTask - cleaning_task(&is_alive, &keep_alive, num_workers, !ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()); + cleaning_task(timing_phase, &is_alive, &keep_alive, num_workers, !ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()); _workers->run_task(&cleaning_task); } else { ShenandoahIsAliveClosure is_alive; #ifdef ASSERT ShenandoahAssertNotForwardedClosure verify_cl; ShenandoahParallelWeakRootsCleaningTask - cleaning_task(&is_alive, &verify_cl, num_workers, !ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()); + cleaning_task(timing_phase, &is_alive, &verify_cl, num_workers, !ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()); #else ShenandoahParallelWeakRootsCleaningTask - cleaning_task(&is_alive, &do_nothing_cl, num_workers, !ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()); + cleaning_task(timing_phase, &is_alive, &do_nothing_cl, num_workers, !ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()); #endif _workers->run_task(&cleaning_task); } @@ -2880,6 +2882,7 @@ void ShenandoahHeap::entry_weak_roots() { EventMark em("%s", msg); ShenandoahGCPhase phase(ShenandoahPhaseTimings::conc_weak_roots); + ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_weak_roots); ShenandoahWorkerScope scope(workers(), ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing(), @@ -2910,6 +2913,7 @@ void ShenandoahHeap::entry_strong_roots() { EventMark em("%s", msg); ShenandoahGCPhase phase(ShenandoahPhaseTimings::conc_strong_roots); + ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_strong_roots); ShenandoahWorkerScope scope(workers(), ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing(), diff --git a/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.hpp b/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.hpp index 885ad1eb179..864799452b1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.hpp @@ -36,6 +36,7 @@ template class ShenandoahParallelWeakRootsCleaningTask : public AbstractGangTask { protected: + ShenandoahPhaseTimings::Phase _phase; WeakProcessor::Task _weak_processing_task; ShenandoahSerialWeakRoots _serial_weak_roots; IsAlive* _is_alive; @@ -43,7 +44,8 @@ class ShenandoahParallelWeakRootsCleaningTask : public AbstractGangTask { bool _include_concurrent_roots; public: - ShenandoahParallelWeakRootsCleaningTask(IsAlive* is_alive, + ShenandoahParallelWeakRootsCleaningTask(ShenandoahPhaseTimings::Phase phase, + IsAlive* is_alive, KeepAlive* keep_alive, uint num_workers, bool include_concurrent_roots); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp index 6fc9266b9db..8d210ba57c6 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.inline.hpp @@ -33,12 +33,13 @@ #include "runtime/safepoint.hpp" template -ShenandoahParallelWeakRootsCleaningTask::ShenandoahParallelWeakRootsCleaningTask(IsAlive* is_alive, +ShenandoahParallelWeakRootsCleaningTask::ShenandoahParallelWeakRootsCleaningTask(ShenandoahPhaseTimings::Phase phase, + IsAlive* is_alive, KeepAlive* keep_alive, uint num_workers, bool include_concurrent_roots) : AbstractGangTask("Parallel Weak Root Cleaning Task"), - _weak_processing_task(num_workers), + _phase(phase), _weak_processing_task(num_workers), _serial_weak_roots(phase), _is_alive(is_alive), _keep_alive(keep_alive), _include_concurrent_roots(include_concurrent_roots) { assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); @@ -63,7 +64,7 @@ void ShenandoahParallelWeakRootsCleaningTask::work(uint work } if (ShenandoahStringDedup::is_enabled()) { - ShenandoahStringDedup::parallel_oops_do(_is_alive, _keep_alive, worker_id); + ShenandoahStringDedup::parallel_oops_do(_phase, _is_alive, _keep_alive, worker_id); } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp index 143b144875c..cec096e160d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp @@ -38,24 +38,24 @@ #define SHENANDOAH_US_TIME_FORMAT "%8.0lf" #define SHENANDOAH_US_WORKER_TIME_FORMAT "%3.0lf" -#define GC_PHASE_DECLARE_NAME(type, title) \ +#define SHENANDOAH_PHASE_DECLARE_NAME(type, title) \ title, const char* ShenandoahPhaseTimings::_phase_names[] = { - SHENANDOAH_GC_PHASE_DO(GC_PHASE_DECLARE_NAME) + SHENANDOAH_PHASE_DO(SHENANDOAH_PHASE_DECLARE_NAME) }; -#undef GC_PHASE_DECLARE_NAME +#undef SHENANDOAH_PHASE_DECLARE_NAME -ShenandoahPhaseTimings::ShenandoahPhaseTimings() { - _max_workers = MAX2(ConcGCThreads, ParallelGCThreads); +ShenandoahPhaseTimings::ShenandoahPhaseTimings(uint max_workers) : + _max_workers(max_workers) { assert(_max_workers > 0, "Must have some GC threads"); // Initialize everything to sane defaults for (uint i = 0; i < _num_phases; i++) { #define SHENANDOAH_WORKER_DATA_NULL(type, title) \ _worker_data[i] = NULL; - SHENANDOAH_GC_PAR_PHASE_DO(,, SHENANDOAH_WORKER_DATA_NULL) + SHENANDOAH_PAR_PHASE_DO(,, SHENANDOAH_WORKER_DATA_NULL) #undef SHENANDOAH_WORKER_DATA_NULL _cycle_data[i] = 0; } @@ -68,25 +68,23 @@ ShenandoahPhaseTimings::ShenandoahPhaseTimings() { int c = 0; #define SHENANDOAH_WORKER_DATA_INIT(type, title) \ if (c++ != 0) _worker_data[i + c] = new ShenandoahWorkerData(title, _max_workers); - SHENANDOAH_GC_PAR_PHASE_DO(,, SHENANDOAH_WORKER_DATA_INIT) + SHENANDOAH_PAR_PHASE_DO(,, SHENANDOAH_WORKER_DATA_INIT) #undef SHENANDOAH_WORKER_DATA_INIT } } _policy = ShenandoahHeap::heap()->shenandoah_policy(); assert(_policy != NULL, "Can not be NULL"); - - _current_worker_phase = _invalid_phase; } -ShenandoahPhaseTimings::Phase ShenandoahPhaseTimings::worker_par_phase(Phase phase, GCParPhases par_phase) { +ShenandoahPhaseTimings::Phase ShenandoahPhaseTimings::worker_par_phase(Phase phase, ParPhase par_phase) { assert(is_worker_phase(phase), "Phase should accept worker phase times: %s", phase_name(phase)); Phase p = Phase(phase + 1 + par_phase); assert(p >= 0 && p < _num_phases, "Out of bound for: %s", phase_name(phase)); return p; } -ShenandoahWorkerData* ShenandoahPhaseTimings::worker_data(Phase phase, GCParPhases par_phase) { +ShenandoahWorkerData* ShenandoahPhaseTimings::worker_data(Phase phase, ParPhase par_phase) { Phase p = worker_par_phase(phase, par_phase); ShenandoahWorkerData* wd = _worker_data[p]; assert(wd != NULL, "Counter initialized: %s", phase_name(p)); @@ -109,6 +107,24 @@ bool ShenandoahPhaseTimings::is_worker_phase(Phase phase) { case purge_class_unload: case purge_weak_par: case heap_iteration_roots: + case conc_weak_roots: + case conc_strong_roots: + return true; + default: + return false; + } +} + +bool ShenandoahPhaseTimings::is_root_work_phase(Phase phase) { + switch (phase) { + case scan_roots: + case update_roots: + case init_evac: + case final_update_refs_roots: + case degen_gc_update_roots: + case full_gc_scan_roots: + case full_gc_update_roots: + case full_gc_adjust_roots: return true; default: return false; @@ -132,18 +148,13 @@ void ShenandoahPhaseTimings::record_phase_time(Phase phase, double time) { void ShenandoahPhaseTimings::record_workers_start(Phase phase) { assert(is_worker_phase(phase), "Phase should accept worker phase times: %s", phase_name(phase)); - assert(_current_worker_phase == _invalid_phase, "Should not be set yet: requested %s, existing %s", - phase_name(phase), phase_name(_current_worker_phase)); - _current_worker_phase = phase; - - for (uint i = 1; i < GCParPhasesSentinel; i++) { - worker_data(phase, GCParPhases(i))->reset(); + for (uint i = 1; i < _num_par_phases; i++) { + worker_data(phase, ParPhase(i))->reset(); } } void ShenandoahPhaseTimings::record_workers_end(Phase phase) { assert(is_worker_phase(phase), "Phase should accept worker phase times: %s", phase_name(phase)); - _current_worker_phase = _invalid_phase; } void ShenandoahPhaseTimings::flush_par_workers_to_cycle() { @@ -151,8 +162,8 @@ void ShenandoahPhaseTimings::flush_par_workers_to_cycle() { Phase phase = Phase(pi); if (is_worker_phase(phase)) { double s = 0; - for (uint i = 1; i < GCParPhasesSentinel; i++) { - double t = worker_data(phase, GCParPhases(i))->sum(); + for (uint i = 1; i < _num_par_phases; i++) { + double t = worker_data(phase, ParPhase(i))->sum(); // add to each line in phase set_cycle_data(Phase(phase + i + 1), t); s += t; @@ -182,7 +193,7 @@ void ShenandoahPhaseTimings::print_cycle_on(outputStream* out) const { out->print(SHENANDOAH_PHASE_NAME_FORMAT " " SHENANDOAH_US_TIME_FORMAT " us", _phase_names[i], v); if (_worker_data[i] != NULL) { out->print(", workers (us): "); - for (size_t c = 0; c < _max_workers; c++) { + for (uint c = 0; c < _max_workers; c++) { double tv = _worker_data[i]->get(c); if (tv != ShenandoahWorkerData::uninitialized()) { out->print(SHENANDOAH_US_WORKER_TIME_FORMAT ", ", tv * 1000000.0); @@ -233,9 +244,11 @@ void ShenandoahPhaseTimings::print_global_on(outputStream* out) const { } } -ShenandoahWorkerTimingsTracker::ShenandoahWorkerTimingsTracker(ShenandoahPhaseTimings::GCParPhases par_phase, uint worker_id) : - _timings(ShenandoahHeap::heap()->phase_timings()), _phase(_timings->current_worker_phase()), - _par_phase(par_phase), _worker_id(worker_id) { +ShenandoahWorkerTimingsTracker::ShenandoahWorkerTimingsTracker(ShenandoahPhaseTimings::Phase phase, + ShenandoahPhaseTimings::ParPhase par_phase, uint worker_id) : + _timings(ShenandoahHeap::heap()->phase_timings()), + _phase(phase), _par_phase(par_phase), _worker_id(worker_id) { + assert(_timings->worker_data(_phase, _par_phase)->get(_worker_id) == ShenandoahWorkerData::uninitialized(), "Should not be set yet: %s", ShenandoahPhaseTimings::phase_name(_timings->worker_par_phase(_phase, _par_phase))); _start_time = os::elapsedTime(); @@ -244,8 +257,8 @@ ShenandoahWorkerTimingsTracker::ShenandoahWorkerTimingsTracker(ShenandoahPhaseTi ShenandoahWorkerTimingsTracker::~ShenandoahWorkerTimingsTracker() { _timings->worker_data(_phase, _par_phase)->set(_worker_id, os::elapsedTime() - _start_time); - if (ShenandoahGCPhase::is_root_work_phase()) { - ShenandoahPhaseTimings::Phase root_phase = ShenandoahGCPhase::current_phase(); + if (ShenandoahPhaseTimings::is_root_work_phase(_phase)) { + ShenandoahPhaseTimings::Phase root_phase = _phase; ShenandoahPhaseTimings::Phase cur_phase = _timings->worker_par_phase(root_phase, _par_phase); _event.commit(GCId::current(), _worker_id, ShenandoahPhaseTimings::phase_name(cur_phase)); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp index d91a78113db..4381fca439d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp @@ -33,7 +33,7 @@ class ShenandoahCollectorPolicy; class outputStream; -#define SHENANDOAH_GC_PAR_PHASE_DO(CNT_PREFIX, DESC_PREFIX, f) \ +#define SHENANDOAH_PAR_PHASE_DO(CNT_PREFIX, DESC_PREFIX, f) \ f(CNT_PREFIX ## TotalWork, DESC_PREFIX "") \ f(CNT_PREFIX ## ThreadRoots, DESC_PREFIX "Thread Roots") \ f(CNT_PREFIX ## CodeCacheRoots, DESC_PREFIX "Code Cache Roots") \ @@ -56,7 +56,7 @@ class outputStream; f(CNT_PREFIX ## FinishQueues, DESC_PREFIX "Finish Queues") \ // end -#define SHENANDOAH_GC_PHASE_DO(f) \ +#define SHENANDOAH_PHASE_DO(f) \ f(conc_reset, "Concurrent Reset") \ \ f(init_mark_gross, "Pause Init Mark (G)") \ @@ -64,7 +64,7 @@ class outputStream; f(make_parsable, " Make Parsable") \ f(init_update_region_states, " Update Region States") \ f(scan_roots, " Scan Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(scan_, " S: ", f) \ + SHENANDOAH_PAR_PHASE_DO(scan_, " S: ", f) \ f(resize_tlabs, " Resize TLABs") \ \ f(conc_mark, "Concurrent Marking") \ @@ -73,27 +73,29 @@ class outputStream; f(final_mark_gross, "Pause Final Mark (G)") \ f(final_mark, "Pause Final Mark (N)") \ f(update_roots, " Update Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(update_, " U: ", f) \ + SHENANDOAH_PAR_PHASE_DO(update_, " U: ", f) \ f(finish_queues, " Finish Queues") \ f(weakrefs, " Weak References") \ f(weakrefs_process, " Process") \ f(purge, " System Purge") \ f(purge_class_unload, " Unload Classes") \ - SHENANDOAH_GC_PAR_PHASE_DO(purge_cu_par_, " CU: ", f) \ + SHENANDOAH_PAR_PHASE_DO(purge_cu_par_, " CU: ", f) \ f(purge_weak_par, " Weak Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(purge_weak_par_, " WR: ", f) \ + SHENANDOAH_PAR_PHASE_DO(purge_weak_par_, " WR: ", f) \ f(purge_cldg, " CLDG") \ f(final_update_region_states, " Update Region States") \ f(retire_tlabs, " Retire TLABs") \ f(choose_cset, " Choose Collection Set") \ f(final_rebuild_freeset, " Rebuild Free Set") \ f(init_evac, " Initial Evacuation") \ - SHENANDOAH_GC_PAR_PHASE_DO(evac_, " E: ", f) \ + SHENANDOAH_PAR_PHASE_DO(evac_, " E: ", f) \ \ f(conc_weak_roots, "Concurrent Weak Roots") \ + SHENANDOAH_PAR_PHASE_DO(conc_weak_roots_, " CWR: ", f) \ f(conc_cleanup_early, "Concurrent Cleanup") \ f(conc_class_unloading, "Concurrent Class Unloading") \ f(conc_strong_roots, "Concurrent Strong Roots") \ + SHENANDOAH_PAR_PHASE_DO(conc_strong_roots_, " CSR: ", f) \ f(conc_evac, "Concurrent Evacuation") \ \ f(init_update_refs_gross, "Pause Init Update Refs (G)") \ @@ -106,7 +108,7 @@ class outputStream; f(final_update_refs, "Pause Final Update Refs (N)") \ f(final_update_refs_finish_work, " Finish Work") \ f(final_update_refs_roots, " Update Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(final_update_, " UR: ", f) \ + SHENANDOAH_PAR_PHASE_DO(final_update_, " UR: ", f) \ f(final_update_refs_update_region_states, " Update Region States") \ f(final_update_refs_trash_cset, " Trash Collection Set") \ f(final_update_refs_rebuild_freeset, " Rebuild Free Set") \ @@ -116,32 +118,32 @@ class outputStream; f(degen_gc_gross, "Pause Degenerated GC (G)") \ f(degen_gc, "Pause Degenerated GC (N)") \ f(degen_gc_update_roots, " Degen Update Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(degen_gc_update_, " DU: ", f) \ + SHENANDOAH_PAR_PHASE_DO(degen_gc_update_, " DU: ", f) \ \ f(full_gc_gross, "Pause Full GC (G)") \ f(full_gc, "Pause Full GC (N)") \ f(full_gc_heapdump_pre, " Pre Heap Dump") \ f(full_gc_prepare, " Prepare") \ f(full_gc_scan_roots, " Scan Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(full_gc_scan_roots_, " FS: ", f) \ + SHENANDOAH_PAR_PHASE_DO(full_gc_scan_roots_, " FS: ", f) \ f(full_gc_update_roots, " Update Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(full_gc_update_roots_, " FU: ", f) \ + SHENANDOAH_PAR_PHASE_DO(full_gc_update_roots_, " FU: ", f) \ f(full_gc_mark, " Mark") \ f(full_gc_mark_finish_queues, " Finish Queues") \ f(full_gc_weakrefs, " Weak References") \ f(full_gc_weakrefs_process, " Process") \ f(full_gc_purge, " System Purge") \ f(full_gc_purge_class_unload, " Unload Classes") \ - SHENANDOAH_GC_PAR_PHASE_DO(full_gc_purge_cu_par_, " CU: ", f) \ + SHENANDOAH_PAR_PHASE_DO(full_gc_purge_cu_par_, " CU: ", f) \ f(full_gc_purge_weak_par, " Weak Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(full_gc_purge_weak_p_, " WR: ", f) \ + SHENANDOAH_PAR_PHASE_DO(full_gc_purge_weak_p_, " WR: ", f) \ f(full_gc_purge_cldg, " CLDG") \ f(full_gc_calculate_addresses, " Calculate Addresses") \ f(full_gc_calculate_addresses_regular, " Regular Objects") \ f(full_gc_calculate_addresses_humong, " Humongous Objects") \ f(full_gc_adjust_pointers, " Adjust Pointers") \ f(full_gc_adjust_roots, " Adjust Roots") \ - SHENANDOAH_GC_PAR_PHASE_DO(full_gc_adjust_roots_, " FA: ", f) \ + SHENANDOAH_PAR_PHASE_DO(full_gc_adjust_roots_, " FA: ", f) \ f(full_gc_copy_objects, " Copy Objects") \ f(full_gc_copy_objects_regular, " Regular Objects") \ f(full_gc_copy_objects_humong, " Humongous Objects") \ @@ -153,7 +155,7 @@ class outputStream; f(conc_uncommit, "Concurrent Uncommit") \ \ f(heap_iteration_roots, "Heap Iteration") \ - SHENANDOAH_GC_PAR_PHASE_DO(heap_iteration_roots_, " HI: ", f) \ + SHENANDOAH_PAR_PHASE_DO(heap_iteration_roots_, " HI: ", f) \ // end typedef WorkerDataArray ShenandoahWorkerData; @@ -162,41 +164,40 @@ class ShenandoahPhaseTimings : public CHeapObj { friend class ShenandoahGCPhase; friend class ShenandoahWorkerTimingsTracker; public: -#define GC_PHASE_DECLARE_ENUM(type, title) type, +#define SHENANDOAH_PHASE_DECLARE_ENUM(type, title) type, enum Phase { - SHENANDOAH_GC_PHASE_DO(GC_PHASE_DECLARE_ENUM) + SHENANDOAH_PHASE_DO(SHENANDOAH_PHASE_DECLARE_ENUM) _num_phases, _invalid_phase = _num_phases }; - enum GCParPhases { - SHENANDOAH_GC_PAR_PHASE_DO(,, GC_PHASE_DECLARE_ENUM) - GCParPhasesSentinel + enum ParPhase { + SHENANDOAH_PAR_PHASE_DO(,, SHENANDOAH_PHASE_DECLARE_ENUM) + _num_par_phases }; -#undef GC_PHASE_DECLARE_ENUM +#undef SHENANDOAH_PHASE_DECLARE_ENUM private: - size_t _max_workers; + uint _max_workers; double _cycle_data[_num_phases]; HdrSeq _global_data[_num_phases]; static const char* _phase_names[_num_phases]; - Phase _current_worker_phase; ShenandoahWorkerData* _worker_data[_num_phases]; ShenandoahCollectorPolicy* _policy; static bool is_worker_phase(Phase phase); - Phase current_worker_phase() { return _current_worker_phase; } + static bool is_root_work_phase(Phase phase); - ShenandoahWorkerData* worker_data(Phase phase, GCParPhases par_phase); - Phase worker_par_phase(Phase phase, GCParPhases par_phase); + ShenandoahWorkerData* worker_data(Phase phase, ParPhase par_phase); + Phase worker_par_phase(Phase phase, ParPhase par_phase); void set_cycle_data(Phase phase, double time); public: - ShenandoahPhaseTimings(); + ShenandoahPhaseTimings(uint _max_workers); void record_phase_time(Phase phase, double time); @@ -217,15 +218,15 @@ class ShenandoahPhaseTimings : public CHeapObj { class ShenandoahWorkerTimingsTracker : public StackObj { private: - ShenandoahPhaseTimings* const _timings; - ShenandoahPhaseTimings::Phase const _phase; - ShenandoahPhaseTimings::GCParPhases const _par_phase; + ShenandoahPhaseTimings* const _timings; + ShenandoahPhaseTimings::Phase const _phase; + ShenandoahPhaseTimings::ParPhase const _par_phase; uint const _worker_id; double _start_time; EventGCPhaseParallel _event; public: - ShenandoahWorkerTimingsTracker(ShenandoahPhaseTimings::GCParPhases par_phase, uint worker_id); + ShenandoahWorkerTimingsTracker(ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase, uint worker_id); ~ShenandoahWorkerTimingsTracker(); }; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp index 0e69f8b27a6..70a8155cc1c 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp @@ -42,13 +42,14 @@ #include "runtime/thread.hpp" #include "services/management.hpp" -ShenandoahSerialRoot::ShenandoahSerialRoot(ShenandoahSerialRoot::OopsDo oops_do, ShenandoahPhaseTimings::GCParPhases phase) : - _oops_do(oops_do), _phase(phase) { +ShenandoahSerialRoot::ShenandoahSerialRoot(ShenandoahSerialRoot::OopsDo oops_do, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase) : + _oops_do(oops_do), _phase(phase), _par_phase(par_phase) { } void ShenandoahSerialRoot::oops_do(OopClosure* cl, uint worker_id) { if (_claimed.try_set()) { - ShenandoahWorkerTimingsTracker timer(_phase, worker_id); + ShenandoahWorkerTimingsTracker timer(_phase, _par_phase, worker_id); _oops_do(cl); } } @@ -58,12 +59,12 @@ static void system_dictionary_oops_do(OopClosure* cl) { SystemDictionary::oops_do(cl, false); } -ShenandoahSerialRoots::ShenandoahSerialRoots() : - _universe_root(&Universe::oops_do, ShenandoahPhaseTimings::UniverseRoots), - _object_synchronizer_root(&ObjectSynchronizer::oops_do, ShenandoahPhaseTimings::ObjectSynchronizerRoots), - _management_root(&Management::oops_do, ShenandoahPhaseTimings::ManagementRoots), - _system_dictionary_root(&system_dictionary_oops_do, ShenandoahPhaseTimings::SystemDictionaryRoots), - _jvmti_root(&JvmtiExport::oops_do, ShenandoahPhaseTimings::JVMTIRoots) { +ShenandoahSerialRoots::ShenandoahSerialRoots(ShenandoahPhaseTimings::Phase phase) : + _universe_root(&Universe::oops_do, phase, ShenandoahPhaseTimings::UniverseRoots), + _object_synchronizer_root(&ObjectSynchronizer::oops_do, phase, ShenandoahPhaseTimings::ObjectSynchronizerRoots), + _management_root(&Management::oops_do, phase, ShenandoahPhaseTimings::ManagementRoots), + _system_dictionary_root(&system_dictionary_oops_do, phase, ShenandoahPhaseTimings::SystemDictionaryRoots), + _jvmti_root(&JvmtiExport::oops_do, phase, ShenandoahPhaseTimings::JVMTIRoots) { } void ShenandoahSerialRoots::oops_do(OopClosure* cl, uint worker_id) { @@ -74,26 +75,27 @@ void ShenandoahSerialRoots::oops_do(OopClosure* cl, uint worker_id) { _jvmti_root.oops_do(cl, worker_id); } -ShenandoahWeakSerialRoot::ShenandoahWeakSerialRoot(ShenandoahWeakSerialRoot::WeakOopsDo weak_oops_do, ShenandoahPhaseTimings::GCParPhases phase) : - _weak_oops_do(weak_oops_do), _phase(phase) { +ShenandoahWeakSerialRoot::ShenandoahWeakSerialRoot(ShenandoahWeakSerialRoot::WeakOopsDo weak_oops_do, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase) : + _weak_oops_do(weak_oops_do), _phase(phase), _par_phase(par_phase) { } void ShenandoahWeakSerialRoot::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id) { if (_claimed.try_set()) { - ShenandoahWorkerTimingsTracker timer(_phase, worker_id); + ShenandoahWorkerTimingsTracker timer(_phase, _par_phase, worker_id); _weak_oops_do(is_alive, keep_alive); } } #if INCLUDE_JVMTI -ShenandoahJVMTIWeakRoot::ShenandoahJVMTIWeakRoot() : - ShenandoahWeakSerialRoot(&JvmtiExport::weak_oops_do, ShenandoahPhaseTimings::JVMTIWeakRoots) { +ShenandoahJVMTIWeakRoot::ShenandoahJVMTIWeakRoot(ShenandoahPhaseTimings::Phase phase) : + ShenandoahWeakSerialRoot(&JvmtiExport::weak_oops_do, phase, ShenandoahPhaseTimings::JVMTIWeakRoots) { } #endif // INCLUDE_JVMTI #if INCLUDE_JFR -ShenandoahJFRWeakRoot::ShenandoahJFRWeakRoot() : - ShenandoahWeakSerialRoot(&Jfr::weak_oops_do, ShenandoahPhaseTimings::JFRWeakRoots) { +ShenandoahJFRWeakRoot::ShenandoahJFRWeakRoot(ShenandoahPhaseTimings::Phase phase) : + ShenandoahWeakSerialRoot(&Jfr::weak_oops_do, phase, ShenandoahPhaseTimings::JFRWeakRoots) { } #endif // INCLUDE_JFR @@ -107,18 +109,19 @@ void ShenandoahSerialWeakRoots::weak_oops_do(OopClosure* cl, uint worker_id) { weak_oops_do(&always_true, cl, worker_id); } -ShenandoahThreadRoots::ShenandoahThreadRoots(bool is_par) : _is_par(is_par) { +ShenandoahThreadRoots::ShenandoahThreadRoots(ShenandoahPhaseTimings::Phase phase, bool is_par) : + _phase(phase), _is_par(is_par) { Threads::change_thread_claim_token(); } void ShenandoahThreadRoots::oops_do(OopClosure* oops_cl, CodeBlobClosure* code_cl, uint worker_id) { - ShenandoahWorkerTimingsTracker timer(ShenandoahPhaseTimings::ThreadRoots, worker_id); + ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::ThreadRoots, worker_id); ResourceMark rm; Threads::possibly_parallel_oops_do(_is_par, oops_cl, code_cl); } void ShenandoahThreadRoots::threads_do(ThreadClosure* tc, uint worker_id) { - ShenandoahWorkerTimingsTracker timer(ShenandoahPhaseTimings::ThreadRoots, worker_id); + ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::ThreadRoots, worker_id); ResourceMark rm; Threads::possibly_parallel_threads_do(_is_par, tc); } @@ -127,7 +130,7 @@ ShenandoahThreadRoots::~ShenandoahThreadRoots() { Threads::assert_all_threads_claimed(); } -ShenandoahStringDedupRoots::ShenandoahStringDedupRoots() { +ShenandoahStringDedupRoots::ShenandoahStringDedupRoots(ShenandoahPhaseTimings::Phase phase) : _phase(phase) { if (ShenandoahStringDedup::is_enabled()) { StringDedup::gc_prologue(false); } @@ -141,7 +144,7 @@ ShenandoahStringDedupRoots::~ShenandoahStringDedupRoots() { void ShenandoahStringDedupRoots::oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id) { if (ShenandoahStringDedup::is_enabled()) { - ShenandoahStringDedup::parallel_oops_do(is_alive, keep_alive, worker_id); + ShenandoahStringDedup::parallel_oops_do(_phase, is_alive, keep_alive, worker_id); } } @@ -184,7 +187,14 @@ ShenandoahRootEvacuator::ShenandoahRootEvacuator(uint n_workers, bool stw_roots_processing, bool stw_class_unloading) : ShenandoahRootProcessor(phase), - _thread_roots(n_workers > 1), + _serial_roots(phase), + _vm_roots(phase), + _cld_roots(phase), + _thread_roots(phase, n_workers > 1), + _serial_weak_roots(phase), + _weak_roots(phase), + _dedup_roots(phase), + _code_roots(phase), _stw_roots_processing(stw_roots_processing), _stw_class_unloading(stw_class_unloading) { } @@ -217,12 +227,26 @@ void ShenandoahRootEvacuator::roots_do(uint worker_id, OopClosure* oops) { ShenandoahRootUpdater::ShenandoahRootUpdater(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), - _thread_roots(n_workers > 1) { + _serial_roots(phase), + _vm_roots(phase), + _cld_roots(phase), + _thread_roots(phase, n_workers > 1), + _serial_weak_roots(phase), + _weak_roots(phase), + _dedup_roots(phase), + _code_roots(phase) { } ShenandoahRootAdjuster::ShenandoahRootAdjuster(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), - _thread_roots(n_workers > 1) { + _serial_roots(phase), + _vm_roots(phase), + _cld_roots(phase), + _thread_roots(phase, n_workers > 1), + _serial_weak_roots(phase), + _weak_roots(phase), + _dedup_roots(phase), + _code_roots(phase) { assert(ShenandoahHeap::heap()->is_full_gc_in_progress(), "Full GC only"); } @@ -247,9 +271,15 @@ void ShenandoahRootAdjuster::roots_do(uint worker_id, OopClosure* oops) { _dedup_roots.oops_do(&always_true, oops, worker_id); } - ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner() : +ShenandoahHeapIterationRootScanner::ShenandoahHeapIterationRootScanner() : ShenandoahRootProcessor(ShenandoahPhaseTimings::heap_iteration_roots), - _thread_roots(false /*is par*/) { + _serial_roots(ShenandoahPhaseTimings::heap_iteration_roots), + _thread_roots(ShenandoahPhaseTimings::heap_iteration_roots, false /*is par*/), + _vm_roots(ShenandoahPhaseTimings::heap_iteration_roots), + _cld_roots(ShenandoahPhaseTimings::heap_iteration_roots), + _serial_weak_roots(ShenandoahPhaseTimings::heap_iteration_roots), + _weak_roots(ShenandoahPhaseTimings::heap_iteration_roots), + _code_roots(ShenandoahPhaseTimings::heap_iteration_roots) { } void ShenandoahHeapIterationRootScanner::roots_do(OopClosure* oops) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp index 43558a5660e..5d2773a7c56 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp @@ -38,12 +38,14 @@ class ShenandoahSerialRoot { public: typedef void (*OopsDo)(OopClosure*); private: - ShenandoahSharedFlag _claimed; - const OopsDo _oops_do; - const ShenandoahPhaseTimings::GCParPhases _phase; + ShenandoahSharedFlag _claimed; + const OopsDo _oops_do; + const ShenandoahPhaseTimings::Phase _phase; + const ShenandoahPhaseTimings::ParPhase _par_phase; public: - ShenandoahSerialRoot(OopsDo oops_do, ShenandoahPhaseTimings::GCParPhases); + ShenandoahSerialRoot(OopsDo oops_do, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase); void oops_do(OopClosure* cl, uint worker_id); }; @@ -55,33 +57,35 @@ class ShenandoahSerialRoots { ShenandoahSerialRoot _system_dictionary_root; ShenandoahSerialRoot _jvmti_root; public: - ShenandoahSerialRoots(); + ShenandoahSerialRoots(ShenandoahPhaseTimings::Phase phase); void oops_do(OopClosure* cl, uint worker_id); }; class ShenandoahWeakSerialRoot { typedef void (*WeakOopsDo)(BoolObjectClosure*, OopClosure*); private: - ShenandoahSharedFlag _claimed; - const WeakOopsDo _weak_oops_do; - const ShenandoahPhaseTimings::GCParPhases _phase; + ShenandoahSharedFlag _claimed; + const WeakOopsDo _weak_oops_do; + const ShenandoahPhaseTimings::Phase _phase; + const ShenandoahPhaseTimings::ParPhase _par_phase; public: - ShenandoahWeakSerialRoot(WeakOopsDo oops_do, ShenandoahPhaseTimings::GCParPhases); + ShenandoahWeakSerialRoot(WeakOopsDo oops_do, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase); void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id); }; #if INCLUDE_JVMTI class ShenandoahJVMTIWeakRoot : public ShenandoahWeakSerialRoot { public: - ShenandoahJVMTIWeakRoot(); + ShenandoahJVMTIWeakRoot(ShenandoahPhaseTimings::Phase phase); }; #endif // INCLUDE_JVMTI #if INCLUDE_JFR class ShenandoahJFRWeakRoot : public ShenandoahWeakSerialRoot { public: - ShenandoahJFRWeakRoot(); + ShenandoahJFRWeakRoot(ShenandoahPhaseTimings::Phase phase); }; #endif // INCLUDE_JFR @@ -90,6 +94,9 @@ class ShenandoahSerialWeakRoots { JVMTI_ONLY(ShenandoahJVMTIWeakRoot _jvmti_weak_roots;) JFR_ONLY(ShenandoahJFRWeakRoot _jfr_weak_roots;) public: + ShenandoahSerialWeakRoots(ShenandoahPhaseTimings::Phase phase) : + JVMTI_ONLY(_jvmti_weak_roots(phase)) + JFR_ONLY(JVMTI_ONLY(COMMA)_jfr_weak_roots(phase)) {}; void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id); void weak_oops_do(OopClosure* cl, uint worker_id); }; @@ -98,9 +105,11 @@ template class ShenandoahVMRoot { private: OopStorage::ParState _itr; - const ShenandoahPhaseTimings::GCParPhases _phase; + const ShenandoahPhaseTimings::Phase _phase; + const ShenandoahPhaseTimings::ParPhase _par_phase; public: - ShenandoahVMRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase); + ShenandoahVMRoot(OopStorage* storage, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase); template void oops_do(Closure* cl, uint worker_id); @@ -109,17 +118,20 @@ class ShenandoahVMRoot { template class ShenandoahWeakRoot : public ShenandoahVMRoot { public: - ShenandoahWeakRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase); + ShenandoahWeakRoot(OopStorage* storage, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase); }; template <> class ShenandoahWeakRoot { private: OopStorage::ParState _itr; - const ShenandoahPhaseTimings::GCParPhases _phase; + const ShenandoahPhaseTimings::Phase _phase; + const ShenandoahPhaseTimings::ParPhase _par_phase; public: - ShenandoahWeakRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase); + ShenandoahWeakRoot(OopStorage* storage, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase); template void weak_oops_do(IsAliveClosure* is_alive, KeepAliveClosure* keep_alive, uint worker_id); @@ -148,7 +160,7 @@ class ShenandoahWeakRoots { ShenandoahWeakRoot _resolved_method_table_roots; ShenandoahWeakRoot _vm_roots; public: - ShenandoahWeakRoots(); + ShenandoahWeakRoots(ShenandoahPhaseTimings::Phase phase); template void oops_do(Closure* cl, uint worker_id); @@ -164,7 +176,7 @@ class ShenandoahVMRoots { ShenandoahVMRoot _vm_global_roots; public: - ShenandoahVMRoots(); + ShenandoahVMRoots(ShenandoahPhaseTimings::Phase phase); template void oops_do(T* cl, uint worker_id); @@ -172,9 +184,10 @@ class ShenandoahVMRoots { class ShenandoahThreadRoots { private: + ShenandoahPhaseTimings::Phase _phase; const bool _is_par; public: - ShenandoahThreadRoots(bool is_par); + ShenandoahThreadRoots(ShenandoahPhaseTimings::Phase phase, bool is_par); ~ShenandoahThreadRoots(); void oops_do(OopClosure* oops_cl, CodeBlobClosure* code_cl, uint worker_id); @@ -182,8 +195,10 @@ class ShenandoahThreadRoots { }; class ShenandoahStringDedupRoots { +private: + ShenandoahPhaseTimings::Phase _phase; public: - ShenandoahStringDedupRoots(); + ShenandoahStringDedupRoots(ShenandoahPhaseTimings::Phase phase); ~ShenandoahStringDedupRoots(); void oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, uint worker_id); @@ -200,9 +215,10 @@ class ShenandoahConcurrentStringDedupRoots { template class ShenandoahCodeCacheRoots { private: + ShenandoahPhaseTimings::Phase _phase; ITR _coderoots_iterator; public: - ShenandoahCodeCacheRoots(); + ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase); ~ShenandoahCodeCacheRoots(); void code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id); @@ -210,8 +226,10 @@ class ShenandoahCodeCacheRoots { template class ShenandoahClassLoaderDataRoots { +private: + ShenandoahPhaseTimings::Phase _phase; public: - ShenandoahClassLoaderDataRoots(); + ShenandoahClassLoaderDataRoots(ShenandoahPhaseTimings::Phase phase); ~ShenandoahClassLoaderDataRoots(); void always_strong_cld_do(CLDClosure* clds, uint worker_id); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp index 1c1d1a48dad..2b9efc9a339 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp @@ -40,33 +40,32 @@ #include "runtime/safepoint.hpp" template -inline ShenandoahVMRoot::ShenandoahVMRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase) : - _itr(storage), _phase(phase) { +inline ShenandoahVMRoot::ShenandoahVMRoot(OopStorage* storage, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase) : + _itr(storage), _phase(phase), _par_phase(par_phase) { } template template inline void ShenandoahVMRoot::oops_do(Closure* cl, uint worker_id) { - if (CONCURRENT) { - _itr.oops_do(cl); - } else { - ShenandoahWorkerTimingsTracker timer(_phase, worker_id); - _itr.oops_do(cl); - } + ShenandoahWorkerTimingsTracker timer(_phase, _par_phase, worker_id); + _itr.oops_do(cl); } template -inline ShenandoahWeakRoot::ShenandoahWeakRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase) : - ShenandoahVMRoot(storage, phase) { +inline ShenandoahWeakRoot::ShenandoahWeakRoot(OopStorage* storage, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase) : + ShenandoahVMRoot(storage, phase, par_phase) { } -inline ShenandoahWeakRoot::ShenandoahWeakRoot(OopStorage* storage, ShenandoahPhaseTimings::GCParPhases phase) : - _itr(storage), _phase(phase) { +inline ShenandoahWeakRoot::ShenandoahWeakRoot(OopStorage* storage, + ShenandoahPhaseTimings::Phase phase, ShenandoahPhaseTimings::ParPhase par_phase) : + _itr(storage), _phase(phase), _par_phase(par_phase) { } template void ShenandoahWeakRoot::weak_oops_do(IsAliveClosure* is_alive, KeepAliveClosure* keep_alive, uint worker_id) { - ShenandoahWorkerTimingsTracker timer(_phase, worker_id); + ShenandoahWorkerTimingsTracker timer(_phase, _par_phase, worker_id); _itr.weak_oops_do(is_alive, keep_alive); } @@ -87,11 +86,11 @@ void ShenandoahWeakRoots::oops_do(Closure* cl, uint worker_id) { _vm_roots.oops_do(cl, worker_id); } -inline ShenandoahWeakRoots::ShenandoahWeakRoots() : - _jni_roots(OopStorageSet::jni_weak(), ShenandoahPhaseTimings::JNIWeakRoots), - _string_table_roots(OopStorageSet::string_table_weak(), ShenandoahPhaseTimings::StringTableRoots), - _resolved_method_table_roots(OopStorageSet::resolved_method_table_weak(), ShenandoahPhaseTimings::ResolvedMethodTableRoots), - _vm_roots(OopStorageSet::vm_weak(), ShenandoahPhaseTimings::VMWeakRoots) { +inline ShenandoahWeakRoots::ShenandoahWeakRoots(ShenandoahPhaseTimings::Phase phase) : + _jni_roots(OopStorageSet::jni_weak(), phase, ShenandoahPhaseTimings::JNIWeakRoots), + _string_table_roots(OopStorageSet::string_table_weak(), phase, ShenandoahPhaseTimings::StringTableRoots), + _resolved_method_table_roots(OopStorageSet::resolved_method_table_weak(), phase, ShenandoahPhaseTimings::ResolvedMethodTableRoots), + _vm_roots(OopStorageSet::vm_weak(), phase, ShenandoahPhaseTimings::VMWeakRoots) { } template @@ -109,9 +108,9 @@ void ShenandoahWeakRoots::oops_do(Closure* cl, uint work } template -ShenandoahVMRoots::ShenandoahVMRoots() : - _jni_handle_roots(OopStorageSet::jni_global(), ShenandoahPhaseTimings::JNIRoots), - _vm_global_roots(OopStorageSet::vm_global(), ShenandoahPhaseTimings::VMGlobalRoots) { +ShenandoahVMRoots::ShenandoahVMRoots(ShenandoahPhaseTimings::Phase phase) : + _jni_handle_roots(OopStorageSet::jni_global(), phase, ShenandoahPhaseTimings::JNIRoots), + _vm_global_roots(OopStorageSet::vm_global(), phase, ShenandoahPhaseTimings::VMGlobalRoots) { } template @@ -122,7 +121,8 @@ void ShenandoahVMRoots::oops_do(T* cl, uint worker_id) { } template -ShenandoahClassLoaderDataRoots::ShenandoahClassLoaderDataRoots() { +ShenandoahClassLoaderDataRoots::ShenandoahClassLoaderDataRoots(ShenandoahPhaseTimings::Phase phase) : + _phase(phase) { if (!SINGLE_THREADED) { ClassLoaderDataGraph::clear_claimed_marks(); } @@ -145,11 +145,9 @@ void ShenandoahClassLoaderDataRoots::always_strong_ assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); assert(Thread::current()->is_VM_thread(), "Single threaded CLDG iteration can only be done by VM thread"); ClassLoaderDataGraph::always_strong_cld_do(clds); - } else if (CONCURRENT) { - ClassLoaderDataGraph::always_strong_cld_do(clds); } else { - ShenandoahWorkerTimingsTracker timer(ShenandoahPhaseTimings::CLDGRoots, worker_id); - ClassLoaderDataGraph::always_strong_cld_do(clds); + ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CLDGRoots, worker_id); + ClassLoaderDataGraph::always_strong_cld_do(clds); } } @@ -159,22 +157,20 @@ void ShenandoahClassLoaderDataRoots::cld_do(CLDClos assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); assert(Thread::current()->is_VM_thread(), "Single threaded CLDG iteration can only be done by VM thread"); ClassLoaderDataGraph::cld_do(clds); - } else if (CONCURRENT) { - ClassLoaderDataGraph::cld_do(clds); - } else { - ShenandoahWorkerTimingsTracker timer(ShenandoahPhaseTimings::CLDGRoots, worker_id); + } else { + ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CLDGRoots, worker_id); ClassLoaderDataGraph::cld_do(clds); } } template -ShenandoahCodeCacheRoots::ShenandoahCodeCacheRoots() { +ShenandoahCodeCacheRoots::ShenandoahCodeCacheRoots(ShenandoahPhaseTimings::Phase phase) : _phase(phase) { nmethod::oops_do_marking_prologue(); } template void ShenandoahCodeCacheRoots::code_blobs_do(CodeBlobClosure* blob_cl, uint worker_id) { - ShenandoahWorkerTimingsTracker timer(ShenandoahPhaseTimings::CodeCacheRoots, worker_id); + ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CodeCacheRoots, worker_id); _coderoots_iterator.possibly_parallel_blobs_do(blob_cl); } @@ -203,7 +199,12 @@ class ShenandoahParallelOopsDoThreadClosure : public ThreadClosure { template ShenandoahRootScanner::ShenandoahRootScanner(uint n_workers, ShenandoahPhaseTimings::Phase phase) : ShenandoahRootProcessor(phase), - _thread_roots(n_workers > 1) { + _serial_roots(phase), + _thread_roots(phase, n_workers > 1), + _code_roots(phase), + _vm_roots(phase), + _dedup_roots(phase), + _cld_roots(phase) { } template diff --git a/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp b/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp index 822ade2b139..62dd15625a8 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved. + * Copyright (c) 2017, 2020, Red Hat, Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,23 +72,19 @@ void ShenandoahStringDedup::deduplicate(oop java_string) { StringDedupTable::deduplicate(java_string, &dummy); } -void ShenandoahStringDedup::parallel_oops_do(BoolObjectClosure* is_alive, OopClosure* cl, uint worker_id) { +void ShenandoahStringDedup::parallel_oops_do(ShenandoahPhaseTimings::Phase phase, + BoolObjectClosure* is_alive, OopClosure* cl, uint worker_id) { assert(SafepointSynchronize::is_at_safepoint(), "Must be at a safepoint"); assert(is_enabled(), "String deduplication not enabled"); StringDedupUnlinkOrOopsDoClosure sd_cl(is_alive, cl); - if (ShenandoahGCPhase::is_root_work_phase()) { - { - ShenandoahWorkerTimingsTracker x(ShenandoahPhaseTimings::StringDedupQueueRoots, worker_id); - StringDedupQueue::unlink_or_oops_do(&sd_cl); - } - - { - ShenandoahWorkerTimingsTracker x(ShenandoahPhaseTimings::StringDedupTableRoots, worker_id); - StringDedupTable::unlink_or_oops_do(&sd_cl, worker_id); - } - } else { + { + ShenandoahWorkerTimingsTracker x(phase, ShenandoahPhaseTimings::StringDedupQueueRoots, worker_id); StringDedupQueue::unlink_or_oops_do(&sd_cl); + } + + { + ShenandoahWorkerTimingsTracker x(phase, ShenandoahPhaseTimings::StringDedupTableRoots, worker_id); StringDedupTable::unlink_or_oops_do(&sd_cl, worker_id); } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.hpp b/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.hpp index 12ae4516f29..617e95283bb 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahStringDedup.hpp @@ -26,6 +26,7 @@ #define SHARE_GC_SHENANDOAH_SHENANDOAHSTRINGDEDUP_HPP #include "gc/shared/stringdedup/stringDedup.hpp" +#include "gc/shenandoah/shenandoahPhaseTimings.hpp" #include "memory/iterator.hpp" class ShenandoahStringDedup : public StringDedup { @@ -39,7 +40,11 @@ class ShenandoahStringDedup : public StringDedup { // Deduplicate a string, the call is lock-free static void deduplicate(oop java_string); - static void parallel_oops_do(BoolObjectClosure* is_alive, OopClosure* cl, uint worker_id); + static void parallel_oops_do(ShenandoahPhaseTimings::Phase phase, + BoolObjectClosure* is_alive, + OopClosure* cl, + uint worker_id); + static void oops_do_slow(OopClosure* cl); static inline bool is_candidate(oop obj); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp b/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp index 80140ac1b86..db73279d3c7 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahUtils.cpp @@ -125,22 +125,6 @@ bool ShenandoahGCPhase::is_current_phase_valid() { return _current_phase < ShenandoahPhaseTimings::_num_phases; } -bool ShenandoahGCPhase::is_root_work_phase() { - switch(current_phase()) { - case ShenandoahPhaseTimings::scan_roots: - case ShenandoahPhaseTimings::update_roots: - case ShenandoahPhaseTimings::init_evac: - case ShenandoahPhaseTimings::final_update_refs_roots: - case ShenandoahPhaseTimings::degen_gc_update_roots: - case ShenandoahPhaseTimings::full_gc_scan_roots: - case ShenandoahPhaseTimings::full_gc_update_roots: - case ShenandoahPhaseTimings::full_gc_adjust_roots: - return true; - default: - return false; - } -} - ShenandoahGCSubPhase::ShenandoahGCSubPhase(ShenandoahPhaseTimings::Phase phase) : ShenandoahGCPhase(phase), _timer(ShenandoahHeap::heap()->gc_timer()) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp b/src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp index e6e0269e834..842134431c7 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp @@ -90,7 +90,6 @@ class ShenandoahGCPhase : public StackObj { static ShenandoahPhaseTimings::Phase current_phase() { return _current_phase; } static bool is_current_phase_valid(); - static bool is_root_work_phase(); }; class ShenandoahGCSubPhase: public ShenandoahGCPhase { diff --git a/src/hotspot/share/gc/z/zDriver.cpp b/src/hotspot/share/gc/z/zDriver.cpp index e79f2a39bc5..ee25c5ca006 100644 --- a/src/hotspot/share/gc/z/zDriver.cpp +++ b/src/hotspot/share/gc/z/zDriver.cpp @@ -164,7 +164,7 @@ class VM_ZMarkStart : public VM_ZOperation { virtual bool do_operation() { ZStatTimer timer(ZPhasePauseMarkStart); - ZServiceabilityMarkStartTracer tracer; + ZServiceabilityPauseTracer tracer; // Set up soft reference policy const bool clear = should_clear_soft_references(); @@ -189,7 +189,7 @@ class VM_ZMarkEnd : public VM_ZOperation { virtual bool do_operation() { ZStatTimer timer(ZPhasePauseMarkEnd); - ZServiceabilityMarkEndTracer tracer; + ZServiceabilityPauseTracer tracer; return ZHeap::heap()->mark_end(); } }; @@ -206,7 +206,7 @@ class VM_ZRelocateStart : public VM_ZOperation { virtual bool do_operation() { ZStatTimer timer(ZPhasePauseRelocateStart); - ZServiceabilityRelocateStartTracer tracer; + ZServiceabilityPauseTracer tracer; ZHeap::heap()->relocate_start(); return true; } @@ -354,17 +354,19 @@ void ZDriver::check_out_of_memory() { class ZDriverGCScope : public StackObj { private: - GCIdMark _gc_id; - GCCause::Cause _gc_cause; - GCCauseSetter _gc_cause_setter; - ZStatTimer _timer; + GCIdMark _gc_id; + GCCause::Cause _gc_cause; + GCCauseSetter _gc_cause_setter; + ZStatTimer _timer; + ZServiceabilityCycleTracer _tracer; public: ZDriverGCScope(GCCause::Cause cause) : _gc_id(), _gc_cause(cause), _gc_cause_setter(ZCollectedHeap::heap(), cause), - _timer(ZPhaseCycle) { + _timer(ZPhaseCycle), + _tracer() { // Update statistics ZStatCycle::at_start(); } diff --git a/src/hotspot/share/gc/z/zServiceability.cpp b/src/hotspot/share/gc/z/zServiceability.cpp index 485bfe9c384..927f39515fc 100644 --- a/src/hotspot/share/gc/z/zServiceability.cpp +++ b/src/hotspot/share/gc/z/zServiceability.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -138,25 +138,23 @@ ZServiceabilityCounters* ZServiceability::counters() { return _counters; } -ZServiceabilityMemoryUsageTracker::~ZServiceabilityMemoryUsageTracker() { - MemoryService::track_memory_usage(); -} - -ZServiceabilityManagerStatsTracer::ZServiceabilityManagerStatsTracer(bool is_gc_begin, bool is_gc_end) : - _stats(ZHeap::heap()->serviceability_memory_manager(), - ZCollectedHeap::heap()->gc_cause() /* cause */, - true /* allMemoryPoolsAffected */, - is_gc_begin /* recordGCBeginTime */, - is_gc_begin /* recordPreGCUsage */, - true /* recordPeakUsage */, - is_gc_end /* recordPostGCusage */, - true /* recordAccumulatedGCTime */, - is_gc_end /* recordGCEndTime */, - is_gc_end /* countCollection */) {} - -ZServiceabilityCountersTracer::ZServiceabilityCountersTracer() : - _stats(ZHeap::heap()->serviceability_counters()->collector_counters()) {} - -ZServiceabilityCountersTracer::~ZServiceabilityCountersTracer() { +ZServiceabilityCycleTracer::ZServiceabilityCycleTracer() : + _memory_manager_stats(ZHeap::heap()->serviceability_memory_manager(), + ZCollectedHeap::heap()->gc_cause(), + true /* allMemoryPoolsAffected */, + true /* recordGCBeginTime */, + true /* recordPreGCUsage */, + true /* recordPeakUsage */, + true /* recordPostGCUsage */, + true /* recordAccumulatedGCTime */, + true /* recordGCEndTime */, + true /* countCollection */) {} + +ZServiceabilityPauseTracer::ZServiceabilityPauseTracer() : + _svc_gc_marker(SvcGCMarker::CONCURRENT), + _counters_stats(ZHeap::heap()->serviceability_counters()->collector_counters()) {} + +ZServiceabilityPauseTracer::~ZServiceabilityPauseTracer() { ZHeap::heap()->serviceability_counters()->update_sizes(); + MemoryService::track_memory_usage(); } diff --git a/src/hotspot/share/gc/z/zServiceability.hpp b/src/hotspot/share/gc/z/zServiceability.hpp index 9048b21ff61..edb41b51955 100644 --- a/src/hotspot/share/gc/z/zServiceability.hpp +++ b/src/hotspot/share/gc/z/zServiceability.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,46 +64,22 @@ class ZServiceability { ZServiceabilityCounters* counters(); }; -class ZServiceabilityMemoryUsageTracker { -public: - ~ZServiceabilityMemoryUsageTracker(); -}; - -class ZServiceabilityManagerStatsTracer { +class ZServiceabilityCycleTracer : public StackObj { private: - TraceMemoryManagerStats _stats; + TraceMemoryManagerStats _memory_manager_stats; public: - ZServiceabilityManagerStatsTracer(bool is_gc_begin, bool is_gc_end); + ZServiceabilityCycleTracer(); }; -class ZServiceabilityCountersTracer { +class ZServiceabilityPauseTracer : public StackObj { private: - TraceCollectorStats _stats; + SvcGCMarker _svc_gc_marker; + TraceCollectorStats _counters_stats; public: - ZServiceabilityCountersTracer(); - ~ZServiceabilityCountersTracer(); + ZServiceabilityPauseTracer(); + ~ZServiceabilityPauseTracer(); }; -template -class ZServiceabilityTracer : public StackObj { -private: - SvcGCMarker _svc_gc_marker; - ZServiceabilityMemoryUsageTracker _memory_usage_tracker; - ZServiceabilityManagerStatsTracer _manager_stats_tracer; - ZServiceabilityCountersTracer _counters_tracer; - -public: - ZServiceabilityTracer() : - _svc_gc_marker(SvcGCMarker::CONCURRENT), - _memory_usage_tracker(), - _manager_stats_tracer(IsGCStart, IsGCEnd), - _counters_tracer() {} -}; - -typedef ZServiceabilityTracer ZServiceabilityMarkStartTracer; -typedef ZServiceabilityTracer ZServiceabilityMarkEndTracer; -typedef ZServiceabilityTracer ZServiceabilityRelocateStartTracer; - #endif // SHARE_GC_Z_ZSERVICEABILITY_HPP diff --git a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp index 905467dd05d..173759edb95 100644 --- a/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp +++ b/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -342,7 +342,7 @@ void JfrCheckFlightRecordingDCmd::execute(DCmdSource source, TRAPS) { JfrStartFlightRecordingDCmd::JfrStartFlightRecordingDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), _name("name", "Name that can be used to identify recording, e.g. \\\"My Recording\\\"", "STRING", false, NULL), - _settings("settings", "Settings file(s), e.g. profile or default. See JRE_HOME/lib/jfr", "STRING SET", false), + _settings("settings", "Settings file(s), e.g. profile or default. See JAVA_HOME/lib/jfr", "STRING SET", false), _delay("delay", "Delay recording start with (s)econds, (m)inutes), (h)ours), or (d)ays, e.g. 5h.", "NANOTIME", false, "0"), _duration("duration", "Duration of recording in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 300s.", "NANOTIME", false, "0"), _disk("disk", "Recording should be persisted to disk", "BOOLEAN", false), diff --git a/src/hotspot/share/jfr/metadata/metadata.xml b/src/hotspot/share/jfr/metadata/metadata.xml index f48c55c6f9e..ea55abb5d30 100644 --- a/src/hotspot/share/jfr/metadata/metadata.xml +++ b/src/hotspot/share/jfr/metadata/metadata.xml @@ -218,7 +218,6 @@ - @@ -227,7 +226,6 @@ - @@ -726,11 +724,6 @@ - - - diff --git a/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp b/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp index 066c1e8ede6..2c333b28d0f 100644 --- a/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp +++ b/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp @@ -480,9 +480,6 @@ class JfrClassLoaderStatsClosure : public ClassLoaderStatsClosure { event.set_classCount(cls->_classes_count); event.set_chunkSize(cls->_chunk_sz); event.set_blockSize(cls->_block_sz); - event.set_unsafeAnonymousClassCount(cls->_anon_classes_count); - event.set_unsafeAnonymousChunkSize(cls->_anon_chunk_sz); - event.set_unsafeAnonymousBlockSize(cls->_anon_block_sz); event.set_hiddenClassCount(cls->_hidden_classes_count); event.set_hiddenChunkSize(cls->_hidden_chunk_sz); event.set_hiddenBlockSize(cls->_hidden_block_sz); diff --git a/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp b/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp index f91d6c8de66..96e117aa870 100644 --- a/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp +++ b/src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp @@ -87,15 +87,14 @@ bool JfrThreadCPULoadEvent::update_event(EventThreadCPULoad& event, JavaThread* // Avoid reporting percentages above the theoretical max if (user_time + system_time > wallclock_time) { jlong excess = user_time + system_time - wallclock_time; + cur_cpu_time -= excess; if (user_time > excess) { user_time -= excess; cur_user_time -= excess; - cur_cpu_time -= excess; } else { - cur_cpu_time -= excess; excess -= user_time; + cur_user_time -= user_time; user_time = 0; - cur_user_time = 0; system_time -= excess; } } diff --git a/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp b/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp index 79bf4dfa4e4..1b11b6e6db3 100644 --- a/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp +++ b/src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,8 +104,7 @@ bool JfrVirtualMemorySegment::initialize(size_t reservation_size_request_bytes) assert(is_aligned(reservation_size_request_bytes, os::vm_allocation_granularity()), "invariant"); _rs = ReservedSpace(reservation_size_request_bytes, os::vm_allocation_granularity(), - UseLargePages && os::can_commit_large_page_memory(), - false); + UseLargePages && os::can_commit_large_page_memory()); if (!_rs.is_reserved()) { return false; } diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index 6114397d4cb..30d3fdefd6d 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -397,6 +397,7 @@ declare_constant(JVM_ACC_HAS_MONITOR_BYTECODES) \ declare_constant(JVM_ACC_HAS_FINALIZER) \ declare_constant(JVM_ACC_IS_CLONEABLE_FAST) \ + declare_constant(JVM_ACC_IS_HIDDEN_CLASS) \ declare_constant(JVM_ACC_FIELD_INTERNAL) \ declare_constant(JVM_ACC_FIELD_STABLE) \ declare_constant(JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE) \ diff --git a/src/hotspot/share/memory/metaspaceTracer.cpp b/src/hotspot/share/memory/metaspaceTracer.cpp index 824ab97c8bb..5899a2140fe 100644 --- a/src/hotspot/share/memory/metaspaceTracer.cpp +++ b/src/hotspot/share/memory/metaspaceTracer.cpp @@ -62,16 +62,7 @@ void MetaspaceTracer::send_allocation_failure_event(ClassLoaderData *cld, E event; if (event.should_commit()) { event.set_classLoader(cld); - event.set_unsafeAnonymousClassLoader(false); // initialize these - event.set_hiddenClassLoader(false); - if (cld->has_class_mirror_holder()) { - assert(cld->klasses() != NULL, "unexpected NULL for cld->klasses()"); - if (cld->klasses()->is_non_strong_hidden()) { - event.set_hiddenClassLoader(true); - } else { - event.set_unsafeAnonymousClassLoader(true); - } - } + event.set_hiddenClassLoader(cld->has_class_mirror_holder()); event.set_size(word_size * BytesPerWord); event.set_metadataType((u1) mdtype); event.set_metaspaceObjectType((u1) objtype); diff --git a/src/hotspot/share/memory/virtualspace.cpp b/src/hotspot/share/memory/virtualspace.cpp index d8185889513..05027472bed 100644 --- a/src/hotspot/share/memory/virtualspace.cpp +++ b/src/hotspot/share/memory/virtualspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,12 +66,6 @@ ReservedSpace::ReservedSpace(size_t size, size_t alignment, initialize(size, alignment, large, requested_address, false); } -ReservedSpace::ReservedSpace(size_t size, size_t alignment, - bool large, - bool executable) : _fd_for_heap(-1) { - initialize(size, alignment, large, NULL, executable); -} - ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment, bool special, bool executable) : _fd_for_heap(-1) { assert((size % os::vm_allocation_granularity()) == 0, @@ -646,8 +640,8 @@ MemRegion ReservedHeapSpace::region() const { // executable. ReservedCodeSpace::ReservedCodeSpace(size_t r_size, size_t rs_align, - bool large) : - ReservedSpace(r_size, rs_align, large, /*executable*/ true) { + bool large) : ReservedSpace() { + initialize(r_size, rs_align, large, /*requested address*/ NULL, /*executable*/ true); MemTracker::record_virtual_memory_type((address)base(), mtCode); } @@ -1127,7 +1121,7 @@ class TestReservedSpace : AllStatic { bool large = maybe_large && UseLargePages && size >= os::large_page_size(); - ReservedSpace rs(size, alignment, large, false); + ReservedSpace rs(size, alignment, large); assert(rs.base() != NULL, "Must be"); assert(rs.size() == size, "Must be"); @@ -1255,7 +1249,7 @@ class TestVirtualSpace : AllStatic { case Commit: return ReservedSpace(reserve_size_aligned, os::vm_allocation_granularity(), - /* large */ false, /* exec */ false); + /* large */ false); } } @@ -1310,7 +1304,7 @@ class TestVirtualSpace : AllStatic { size_t large_page_size = os::large_page_size(); - ReservedSpace reserved(large_page_size, large_page_size, true, false); + ReservedSpace reserved(large_page_size, large_page_size, true); assert(reserved.is_reserved(), "Must be"); diff --git a/src/hotspot/share/memory/virtualspace.hpp b/src/hotspot/share/memory/virtualspace.hpp index 830b57e5634..9d5688eea02 100644 --- a/src/hotspot/share/memory/virtualspace.hpp +++ b/src/hotspot/share/memory/virtualspace.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,6 @@ class ReservedSpace { ReservedSpace(size_t size, size_t preferred_page_size = 0); ReservedSpace(size_t size, size_t alignment, bool large, char* requested_address = NULL); - ReservedSpace(size_t size, size_t alignment, bool large, bool executable); // Accessors char* base() const { return _base; } diff --git a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp index c7ea31ae1f3..6625bebfd5c 100644 --- a/src/hotspot/share/oops/instanceKlass.cpp +++ b/src/hotspot/share/oops/instanceKlass.cpp @@ -587,9 +587,9 @@ void InstanceKlass::deallocate_contents(ClassLoaderData* loader_data) { // to deallocate. assert(array_klasses() == NULL, "array classes shouldn't be created for this class yet"); - // Release C heap allocated data that this might point to, which includes + // Release C heap allocated data that this points to, which includes // reference counting symbol names. - release_C_heap_structures(); + release_C_heap_structures_internal(); deallocate_methods(loader_data, methods()); set_methods(NULL); @@ -1378,14 +1378,14 @@ Klass* InstanceKlass::array_klass_impl(bool or_null, int n, TRAPS) { // Check if update has already taken place if (array_klasses() == NULL) { - Klass* k = ObjArrayKlass::allocate_objArray_klass(class_loader_data(), 1, this, CHECK_NULL); + ObjArrayKlass* k = ObjArrayKlass::allocate_objArray_klass(class_loader_data(), 1, this, CHECK_NULL); // use 'release' to pair with lock-free load release_set_array_klasses(k); } } } // _this will always be set at this point - ObjArrayKlass* oak = (ObjArrayKlass*)array_klasses(); + ObjArrayKlass* oak = array_klasses(); if (or_null) { return oak->array_klass_or_null(n); } @@ -1624,12 +1624,12 @@ void InstanceKlass::do_nonstatic_fields(FieldClosure* cl) { void InstanceKlass::array_klasses_do(void f(Klass* k, TRAPS), TRAPS) { if (array_klasses() != NULL) - ArrayKlass::cast(array_klasses())->array_klasses_do(f, THREAD); + array_klasses()->array_klasses_do(f, THREAD); } void InstanceKlass::array_klasses_do(void f(Klass* k)) { if (array_klasses() != NULL) - ArrayKlass::cast(array_klasses())->array_klasses_do(f); + array_klasses()->array_klasses_do(f); } #ifdef ASSERT @@ -2386,7 +2386,6 @@ void InstanceKlass::metaspace_pointers_do(MetaspaceClosure* it) { it->push((Klass**)&_array_klasses); it->push(&_constants); it->push(&_inner_classes); - it->push(&_array_name); #if INCLUDE_JVMTI it->push(&_previous_versions); #endif @@ -2513,7 +2512,7 @@ void InstanceKlass::restore_unshareable_info(ClassLoaderData* loader_data, Handl if (array_klasses() != NULL) { // Array classes have null protection domain. // --> see ArrayKlass::complete_create_array_klass() - ArrayKlass::cast(array_klasses())->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK); + array_klasses()->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK); } // Initialize current biased locking state. @@ -2581,17 +2580,19 @@ static void method_release_C_heap_structures(Method* m) { m->release_C_heap_structures(); } -void InstanceKlass::release_C_heap_structures(InstanceKlass* ik) { +void InstanceKlass::release_C_heap_structures() { + // Clean up C heap - ik->release_C_heap_structures(); - ik->constants()->release_C_heap_structures(); + release_C_heap_structures_internal(); + constants()->release_C_heap_structures(); // Deallocate and call destructors for MDO mutexes - ik->methods_do(method_release_C_heap_structures); - + methods_do(method_release_C_heap_structures); } -void InstanceKlass::release_C_heap_structures() { +void InstanceKlass::release_C_heap_structures_internal() { + Klass::release_C_heap_structures(); + // Can't release the constant pool here because the constant pool can be // deallocated separately from the InstanceKlass for default methods and // redefine classes. @@ -2629,12 +2630,6 @@ void InstanceKlass::release_C_heap_structures() { } #endif - // Decrement symbol reference counts associated with the unloaded class. - if (_name != NULL) _name->decrement_refcount(); - - // unreference array name derived from this class name (arrays of an unloaded - // class can't be referenced anymore). - if (_array_name != NULL) _array_name->decrement_refcount(); FREE_C_HEAP_ARRAY(char, _source_debug_extension); } @@ -3719,9 +3714,6 @@ void InstanceKlass::verify_on(outputStream* st) { } // Verify other fields - if (array_klasses() != NULL) { - guarantee(array_klasses()->is_klass(), "should be klass"); - } if (constants() != NULL) { guarantee(constants()->is_constantPool(), "should be constant pool"); } diff --git a/src/hotspot/share/oops/instanceKlass.hpp b/src/hotspot/share/oops/instanceKlass.hpp index ab103d99913..fa57a4dc083 100644 --- a/src/hotspot/share/oops/instanceKlass.hpp +++ b/src/hotspot/share/oops/instanceKlass.hpp @@ -170,7 +170,7 @@ class InstanceKlass: public Klass { // Package this class is defined in PackageEntry* _package_entry; // Array classes holding elements of this class. - Klass* volatile _array_klasses; + ObjArrayKlass* volatile _array_klasses; // Constant pool for this class. ConstantPool* _constants; // The InnerClasses attribute and EnclosingMethod attribute. The @@ -205,9 +205,6 @@ class InstanceKlass: public Klass { // Specified as UTF-8 string without terminating zero byte in the classfile, // it is stored in the instanceklass as a NULL-terminated UTF-8 string const char* _source_debug_extension; - // Array name derived from this class which needs unreferencing - // if this class is unloaded. - Symbol* _array_name; // Number of heapOopSize words used by non-static fields in this klass // (including inherited fields but after header_size()). @@ -393,10 +390,10 @@ class InstanceKlass: public Klass { void set_itable_length(int len) { _itable_len = len; } // array klasses - Klass* array_klasses() const { return _array_klasses; } - inline Klass* array_klasses_acquire() const; // load with acquire semantics - void set_array_klasses(Klass* k) { _array_klasses = k; } - inline void release_set_array_klasses(Klass* k); // store with release semantics + ObjArrayKlass* array_klasses() const { return _array_klasses; } + inline ObjArrayKlass* array_klasses_acquire() const; // load with acquire semantics + void set_array_klasses(ObjArrayKlass* k) { _array_klasses = k; } + inline void release_set_array_klasses(ObjArrayKlass* k); // store with release semantics // methods Array* methods() const { return _methods; } @@ -734,10 +731,6 @@ class InstanceKlass: public Klass { const char* source_debug_extension() const { return _source_debug_extension; } void set_source_debug_extension(const char* array, int length); - // symbol unloading support (refcount already added) - Symbol* array_name() { return _array_name; } - void set_array_name(Symbol* name) { assert(_array_name == NULL || name == NULL, "name already created"); _array_name = name; } - // nonstatic oop-map blocks static int nonstatic_oop_map_size(unsigned int oop_map_count) { return oop_map_count * OopMapBlock::size_in_words(); @@ -1193,7 +1186,8 @@ class InstanceKlass: public Klass { // callbacks for actions during class unloading static void unload_class(InstanceKlass* ik); - static void release_C_heap_structures(InstanceKlass* ik); + + virtual void release_C_heap_structures(); // Naming const char* signature_name() const; @@ -1304,7 +1298,7 @@ class InstanceKlass: public Klass { PrivateLookupMode private_mode); // Free CHeap allocated fields. - void release_C_heap_structures(); + void release_C_heap_structures_internal(); #if INCLUDE_JVMTI // RedefineClasses support diff --git a/src/hotspot/share/oops/instanceKlass.inline.hpp b/src/hotspot/share/oops/instanceKlass.inline.hpp index b0935349ee5..06402664251 100644 --- a/src/hotspot/share/oops/instanceKlass.inline.hpp +++ b/src/hotspot/share/oops/instanceKlass.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,11 +34,11 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" -inline Klass* InstanceKlass::array_klasses_acquire() const { +inline ObjArrayKlass* InstanceKlass::array_klasses_acquire() const { return Atomic::load_acquire(&_array_klasses); } -inline void InstanceKlass::release_set_array_klasses(Klass* k) { +inline void InstanceKlass::release_set_array_klasses(ObjArrayKlass* k) { Atomic::release_store(&_array_klasses, k); } diff --git a/src/hotspot/share/oops/klass.cpp b/src/hotspot/share/oops/klass.cpp index 81f460f907f..5f67159e8e2 100644 --- a/src/hotspot/share/oops/klass.cpp +++ b/src/hotspot/share/oops/klass.cpp @@ -94,6 +94,10 @@ bool Klass::is_subclass_of(const Klass* k) const { return false; } +void Klass::release_C_heap_structures() { + if (_name != NULL) _name->decrement_refcount(); +} + bool Klass::search_secondary_supers(Klass* k) const { // Put some extra logic here out-of-line, before the search proper. // This cuts down the size of the inline method. diff --git a/src/hotspot/share/oops/klass.hpp b/src/hotspot/share/oops/klass.hpp index 3a93d9bd20b..6a13070f166 100644 --- a/src/hotspot/share/oops/klass.hpp +++ b/src/hotspot/share/oops/klass.hpp @@ -674,6 +674,8 @@ class Klass : public Metadata { Symbol* name() const { return _name; } void set_name(Symbol* n); + virtual void release_C_heap_structures(); + public: // jvm support virtual jint compute_modifier_flags(TRAPS) const; diff --git a/src/hotspot/share/oops/objArrayKlass.cpp b/src/hotspot/share/oops/objArrayKlass.cpp index b4647fd380f..7c8651439cf 100644 --- a/src/hotspot/share/oops/objArrayKlass.cpp +++ b/src/hotspot/share/oops/objArrayKlass.cpp @@ -54,8 +54,8 @@ ObjArrayKlass* ObjArrayKlass::allocate(ClassLoaderData* loader_data, int n, Klas return new (loader_data, size, THREAD) ObjArrayKlass(n, k, name); } -Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data, - int n, Klass* element_klass, TRAPS) { +ObjArrayKlass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data, + int n, Klass* element_klass, TRAPS) { // Eagerly allocate the direct array supertype. Klass* super_klass = NULL; @@ -88,7 +88,7 @@ Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data, // Now retry from the beginning ek = element_klass->array_klass(n, CHECK_NULL); } // re-lock - return ek; + return ObjArrayKlass::cast(ek); } } else { // The element type is already Object. Object[] has direct super of Object. @@ -98,9 +98,7 @@ Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data, // Create type name for klass. Symbol* name = NULL; - if (!element_klass->is_instance_klass() || - (name = InstanceKlass::cast(element_klass)->array_name()) == NULL) { - + { ResourceMark rm(THREAD); char *name_str = element_klass->name()->as_C_string(); int len = element_klass->name()->utf8_length(); @@ -116,11 +114,7 @@ Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data, new_str[idx++] = JVM_SIGNATURE_ENDCLASS; } new_str[idx++] = '\0'; - name = SymbolTable::new_permanent_symbol(new_str); - if (element_klass->is_instance_klass()) { - InstanceKlass* ik = InstanceKlass::cast(element_klass); - ik->set_array_name(name); - } + name = SymbolTable::new_symbol(new_str); } // Initialize instance variables @@ -143,12 +137,8 @@ Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data, } ObjArrayKlass::ObjArrayKlass(int n, Klass* element_klass, Symbol* name) : ArrayKlass(name, ID) { - this->set_dimension(n); - this->set_element_klass(element_klass); - // decrement refcount because object arrays are not explicitly freed. The - // InstanceKlass array_name() keeps the name counted while the klass is - // loaded. - name->decrement_refcount(); + set_dimension(n); + set_element_klass(element_klass); Klass* bk; if (element_klass->is_objArray_klass()) { @@ -157,12 +147,12 @@ ObjArrayKlass::ObjArrayKlass(int n, Klass* element_klass, Symbol* name) : ArrayK bk = element_klass; } assert(bk != NULL && (bk->is_instance_klass() || bk->is_typeArray_klass()), "invalid bottom klass"); - this->set_bottom_klass(bk); - this->set_class_loader_data(bk->class_loader_data()); + set_bottom_klass(bk); + set_class_loader_data(bk->class_loader_data()); - this->set_layout_helper(array_layout_helper(T_OBJECT)); - assert(this->is_array_klass(), "sanity"); - assert(this->is_objArray_klass(), "sanity"); + set_layout_helper(array_layout_helper(T_OBJECT)); + assert(is_array_klass(), "sanity"); + assert(is_objArray_klass(), "sanity"); } int ObjArrayKlass::oop_size(oop obj) const { diff --git a/src/hotspot/share/oops/objArrayKlass.hpp b/src/hotspot/share/oops/objArrayKlass.hpp index cce72991f43..e2feb61f4e9 100644 --- a/src/hotspot/share/oops/objArrayKlass.hpp +++ b/src/hotspot/share/oops/objArrayKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,8 +74,8 @@ class ObjArrayKlass : public ArrayKlass { int oop_size(oop obj) const; // Allocation - static Klass* allocate_objArray_klass(ClassLoaderData* loader_data, - int n, Klass* element_klass, TRAPS); + static ObjArrayKlass* allocate_objArray_klass(ClassLoaderData* loader_data, + int n, Klass* element_klass, TRAPS); objArrayOop allocate(int length, TRAPS); oop multi_allocate(int rank, jint* sizes, TRAPS); diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp index a71f527655b..5d1d1fc6b76 100644 --- a/src/hotspot/share/opto/cfgnode.cpp +++ b/src/hotspot/share/opto/cfgnode.cpp @@ -2073,7 +2073,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { } // Accumulate type for resulting Phi base_type = base_type->meet_speculative(in(i)->in(AddPNode::Base)->bottom_type()); - address_type = address_type->meet_speculative(in(i)->in(AddPNode::Base)->bottom_type()); + address_type = address_type->meet_speculative(in(i)->in(AddPNode::Address)->bottom_type()); } if (doit && base == NULL) { // Check for neighboring AddP nodes in a tree. diff --git a/src/hotspot/share/opto/subtypenode.cpp b/src/hotspot/share/opto/subtypenode.cpp index 9b6110b0418..81dfe1e140b 100644 --- a/src/hotspot/share/opto/subtypenode.cpp +++ b/src/hotspot/share/opto/subtypenode.cpp @@ -134,7 +134,14 @@ Node *SubTypeCheckNode::Ideal(PhaseGVN *phase, bool can_reshape) { intptr_t con = 0; Node* obj = AddPNode::Ideal_base_and_offset(addr, phase, con); if (con == oopDesc::klass_offset_in_bytes() && obj != NULL) { - assert(phase->type(obj)->isa_oopptr(), "only for oop input"); +#ifdef ASSERT + const Type* obj_t = phase->type(obj); + if (!obj_t->isa_oopptr() && obj_t != Type::TOP) { + obj->dump(); + obj_t->dump(); tty->cr(); + fatal("only for oop input"); + } +#endif set_req(ObjOrSubKlass, obj); return this; } @@ -143,7 +150,14 @@ Node *SubTypeCheckNode::Ideal(PhaseGVN *phase, bool can_reshape) { // AllocateNode might have more accurate klass input Node* allocated_klass = AllocateNode::Ideal_klass(obj_or_subklass, phase); if (allocated_klass != NULL) { - assert(phase->type(obj_or_subklass)->isa_oopptr(), "only for oop input"); +#ifdef ASSERT + const Type* obj_or_subklass_t = phase->type(obj_or_subklass); + if (!obj_or_subklass_t->isa_oopptr() && obj_or_subklass_t != Type::TOP) { + obj_or_subklass->dump(); + obj_or_subklass_t->dump(); tty->cr(); + fatal("only for oop input"); + } +#endif set_req(ObjOrSubKlass, allocated_klass); return this; } diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 0b40e21c233..828c87bc5c5 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -525,6 +525,7 @@ static SpecialFlag const special_jvm_flags[] = { { "MonitorBound", JDK_Version::jdk(14), JDK_Version::jdk(15), JDK_Version::jdk(16) }, { "PrintVMQWaitTime", JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) }, { "UseNewFieldLayout", JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) }, + { "ForceNUMA", JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) }, // --- 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() }, diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index cb3766f71fa..3da38e060aa 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -192,7 +192,7 @@ const size_t minimumSymbolTableSize = 1024; range(os::vm_allocation_granularity(), NOT_LP64(2*G) LP64_ONLY(8192*G)) \ \ product(bool, ForceNUMA, false, \ - "Force NUMA optimizations on single-node/UMA systems") \ + "(Deprecated) Force NUMA optimizations on single-node/UMA systems") \ \ product(uintx, NUMAChunkResizeWeight, 20, \ "Percentage (0-100) used to weight the current sample when " \ @@ -2483,7 +2483,8 @@ const size_t minimumSymbolTableSize = 1024; product(bool, UseEmptySlotsInSupers, true, \ "Allow allocating fields in empty slots of super-classes") \ \ - + diagnostic(bool, DeoptimizeNMethodBarriersALot, false, \ + "Make nmethod barriers deoptimise a lot.") \ // Interface macros #define DECLARE_PRODUCT_FLAG(type, name, value, doc) extern "C" type name; diff --git a/src/hotspot/share/runtime/sharedRuntime.cpp b/src/hotspot/share/runtime/sharedRuntime.cpp index 2041c6f8089..12ebbf56520 100644 --- a/src/hotspot/share/runtime/sharedRuntime.cpp +++ b/src/hotspot/share/runtime/sharedRuntime.cpp @@ -2851,6 +2851,12 @@ void AdapterHandlerLibrary::create_native_wrapper(const methodHandle& method) { CodeBuffer buffer(buf); double locs_buf[20]; buffer.insts()->initialize_shared_locs((relocInfo*)locs_buf, sizeof(locs_buf) / sizeof(relocInfo)); +#if defined(AARCH64) + // On AArch64 with ZGC and nmethod entry barriers, we need all oops to be + // in the constant pool to ensure ordering between the barrier and oops + // accesses. For native_wrappers we need a constant. + buffer.initialize_consts_size(8); +#endif MacroAssembler _masm(&buffer); // Fill in the signature array, for the calling-convention call. diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 7cc78793af9..0361b79c34d 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -218,7 +218,7 @@ typedef HashtableEntry KlassHashtableEntry; nonstatic_field(ConstantPoolCache, _reference_map, Array*) \ nonstatic_field(ConstantPoolCache, _length, int) \ nonstatic_field(ConstantPoolCache, _constant_pool, ConstantPool*) \ - volatile_nonstatic_field(InstanceKlass, _array_klasses, Klass*) \ + volatile_nonstatic_field(InstanceKlass, _array_klasses, ObjArrayKlass*) \ nonstatic_field(InstanceKlass, _methods, Array*) \ nonstatic_field(InstanceKlass, _default_methods, Array*) \ nonstatic_field(InstanceKlass, _local_interfaces, Array*) \ diff --git a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index e334262693b..f1cc6699bce 100644 --- a/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -236,7 +236,7 @@ private static String makeDumpableClassName(String className) { return className; } - public static class ClassData { + static class ClassData { final String name; final String desc; final Object value; diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 6de440a4e8f..cf92bf7c45b 100644 --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -3960,7 +3960,7 @@ public static MethodHandle arrayElementSetter(Class arrayClass) throws Illega * {@code short}, {@code char}, {@code int}, {@code long}, * {@code float}, or {@code double} then numeric atomic update access * modes are unsupported. - *
  • if the field type is anything other than {@code boolean}, + *
  • if the component type is anything other than {@code boolean}, * {@code byte}, {@code short}, {@code char}, {@code int} or * {@code long} then bitwise atomic update access modes are * unsupported. diff --git a/src/java.base/share/classes/java/lang/invoke/package-info.java b/src/java.base/share/classes/java/lang/invoke/package-info.java index 82600d48665..f69797bf54c 100644 --- a/src/java.base/share/classes/java/lang/invoke/package-info.java +++ b/src/java.base/share/classes/java/lang/invoke/package-info.java @@ -31,7 +31,7 @@ * As described in the Java Virtual Machine Specification, certain types in this package * are given special treatment by the virtual machine: *
      - *
    • The classes {@link java.lang.invoke.MethodHandle MethodHandle} + *
    • The classes {@link java.lang.invoke.MethodHandle MethodHandle} and * {@link java.lang.invoke.VarHandle VarHandle} contain * signature polymorphic methods * which can be linked regardless of their type descriptor. @@ -190,7 +190,7 @@ * invoked with just the parameter types of static arguments, thereby supporting a wider * range of methods compatible with the static arguments (such as methods that don't declare * or require the lookup, name, and type meta-data parameters). - *

      For example, for dynamically-computed call site, a the first argument + *

      For example, for dynamically-computed call site, the first argument * could be {@code Object} instead of {@code MethodHandles.Lookup}, and the return type * could also be {@code Object} instead of {@code CallSite}. * (Note that the types and number of the stacked arguments limit diff --git a/src/java.base/share/classes/java/text/CompactNumberFormat.java b/src/java.base/share/classes/java/text/CompactNumberFormat.java index a55f097a8a7..e9f1c0bd909 100644 --- a/src/java.base/share/classes/java/text/CompactNumberFormat.java +++ b/src/java.base/share/classes/java/text/CompactNumberFormat.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -206,7 +206,7 @@ * {@link java.math.RoundingMode} for formatting. By default, it uses * {@link java.math.RoundingMode#HALF_EVEN RoundingMode.HALF_EVEN}. * - * @see CompactNumberFormat.Style + * @see NumberFormat.Style * @see NumberFormat * @see DecimalFormat * @since 12 diff --git a/src/java.base/share/classes/java/util/zip/ZipCoder.java b/src/java.base/share/classes/java/util/zip/ZipCoder.java index 204f786c4b5..2e74d0f062e 100644 --- a/src/java.base/share/classes/java/util/zip/ZipCoder.java +++ b/src/java.base/share/classes/java/util/zip/ZipCoder.java @@ -32,6 +32,7 @@ import java.nio.charset.CharsetEncoder; import java.nio.charset.CharacterCodingException; import java.nio.charset.CodingErrorAction; +import java.util.Arrays; import sun.nio.cs.UTF_8; @@ -43,51 +44,13 @@ private static final jdk.internal.access.JavaLangAccess JLA = jdk.internal.access.SharedSecrets.getJavaLangAccess(); - static final class UTF8ZipCoder extends ZipCoder { - - // Encoding/decoding is stateless, so make it singleton. - static final ZipCoder INSTANCE = new UTF8ZipCoder(UTF_8.INSTANCE); - - private UTF8ZipCoder(Charset utf8) { - super(utf8); - } - - @Override - boolean isUTF8() { - return true; - } - - @Override - String toString(byte[] ba, int off, int length) { - return JLA.newStringUTF8NoRepl(ba, off, length); - } - - @Override - byte[] getBytes(String s) { - return JLA.getBytesUTF8NoRepl(s); - } - - @Override - int hashN(byte[] a, int off, int len) { - // Performance optimization: when UTF8-encoded, ZipFile.getEntryPos - // assume that the hash of a name remains unchanged when appending a - // trailing '/', which allows lookups to avoid rehashing - int end = off + len; - if (len > 0 && a[end - 1] == '/') { - end--; - } - - int h = 1; - for (int i = off; i < end; i++) { - h = 31 * h + a[i]; - } - return h; - } - } + // Encoding/decoding is stateless, so make it singleton. + static final UTF8ZipCoder UTF8 = new UTF8ZipCoder(UTF_8.INSTANCE); public static ZipCoder get(Charset charset) { - if (charset == UTF_8.INSTANCE) - return UTF8ZipCoder.INSTANCE; + if (charset == UTF_8.INSTANCE) { + return UTF8; + } return new ZipCoder(charset); } @@ -123,40 +86,74 @@ String toString(byte[] ba) { } } - // assume invoked only if "this" is not utf8 - byte[] getBytesUTF8(String s) { - return UTF8ZipCoder.INSTANCE.getBytes(s); + String toStringUTF8(byte[] ba, int len) { + return UTF8.toString(ba, 0, len); } - String toStringUTF8(byte[] ba, int len) { - return UTF8ZipCoder.INSTANCE.toString(ba, 0, len); + boolean isUTF8() { + return false; + } + + // Hash code functions for ZipFile entry names. We generate the hash as-if + // we first decoded the byte sequence to a String, then appended '/' if no + // trailing slash was found, then called String.hashCode(). This + // normalization ensures we can simplify and speed up lookups. + int normalizedHash(byte[] a, int off, int len) { + if (len == 0) { + return 0; + } + return normalizedHashDecode(0, a, off, off + len); } - String toStringUTF8(byte[] ba, int off, int len) { - return UTF8ZipCoder.INSTANCE.toString(ba, off, len); + // Matching normalized hash code function for Strings + static int normalizedHash(String name) { + int hsh = name.hashCode(); + int len = name.length(); + if (len > 0 && name.charAt(len - 1) != '/') { + hsh = hsh * 31 + '/'; + } + return hsh; } - boolean isUTF8() { - return false; + boolean hasTrailingSlash(byte[] a, int end) { + byte[] slashBytes = slashBytes(); + return end >= slashBytes.length && + Arrays.mismatch(a, end - slashBytes.length, end, slashBytes, 0, slashBytes.length) == -1; } - int hashN(byte[] a, int off, int len) { - int h = 1; - while (len-- > 0) { - h = 31 * h + a[off++]; + // Implements normalizedHash by decoding byte[] to char[] and then computing + // the hash. This is a slow-path used for non-UTF8 charsets and also when + // aborting the ASCII fast-path in the UTF8 implementation, so {@code h} + // might be a partially calculated hash code + int normalizedHashDecode(int h, byte[] a, int off, int end) { + try { + // cb will be a newly allocated CharBuffer with pos == 0, + // arrayOffset == 0, backed by an array. + CharBuffer cb = decoder().decode(ByteBuffer.wrap(a, off, end - off)); + int limit = cb.limit(); + char[] decoded = cb.array(); + for (int i = 0; i < limit; i++) { + h = 31 * h + decoded[i]; + } + if (limit > 0 && decoded[limit - 1] != '/') { + h = 31 * h + '/'; + } + } catch (CharacterCodingException cce) { + // Ignore - return the hash code generated so far. } return h; } - private Charset cs; - private CharsetDecoder dec; + private byte[] slashBytes; + private final Charset cs; + protected CharsetDecoder dec; private CharsetEncoder enc; private ZipCoder(Charset cs) { this.cs = cs; } - private CharsetDecoder decoder() { + protected CharsetDecoder decoder() { if (dec == null) { dec = cs.newDecoder() .onMalformedInput(CodingErrorAction.REPORT) @@ -173,4 +170,73 @@ private CharsetEncoder encoder() { } return enc; } + + // This method produces an array with the bytes that will correspond to a + // trailing '/' in the chosen character encoding. + // + // While in most charsets a trailing slash will be encoded as the byte + // value of '/', this does not hold in the general case. E.g., in charsets + // such as UTF-16 and UTF-32 it will be represented by a sequence of 2 or 4 + // bytes, respectively. + private byte[] slashBytes() { + if (slashBytes == null) { + // Take into account charsets that produce a BOM, e.g., UTF-16 + byte[] slash = "/".getBytes(cs); + byte[] doubleSlash = "//".getBytes(cs); + slashBytes = Arrays.copyOfRange(doubleSlash, slash.length, doubleSlash.length); + } + return slashBytes; + } + + static final class UTF8ZipCoder extends ZipCoder { + + private UTF8ZipCoder(Charset utf8) { + super(utf8); + } + + @Override + boolean isUTF8() { + return true; + } + + @Override + String toString(byte[] ba, int off, int length) { + return JLA.newStringUTF8NoRepl(ba, off, length); + } + + @Override + byte[] getBytes(String s) { + return JLA.getBytesUTF8NoRepl(s); + } + + @Override + int normalizedHash(byte[] a, int off, int len) { + if (len == 0) { + return 0; + } + + int end = off + len; + int h = 0; + while (off < end) { + byte b = a[off]; + if (b < 0) { + // Non-ASCII, fall back to decoder loop + return normalizedHashDecode(h, a, off, end); + } else { + h = 31 * h + b; + off++; + } + } + + if (a[end - 1] != '/') { + h = 31 * h + '/'; + } + return h; + } + + @Override + boolean hasTrailingSlash(byte[] a, int end) { + return end > 0 && a[end - 1] == '/'; + } + } } diff --git a/src/java.base/share/classes/java/util/zip/ZipFile.java b/src/java.base/share/classes/java/util/zip/ZipFile.java index a15407a1626..bb05e19454d 100644 --- a/src/java.base/share/classes/java/util/zip/ZipFile.java +++ b/src/java.base/share/classes/java/util/zip/ZipFile.java @@ -92,7 +92,6 @@ private final String name; // zip file name private volatile boolean closeRequested; - private final @Stable ZipCoder zc; // The "resource" used by this zip file that needs to be // cleaned after use. @@ -232,11 +231,10 @@ public ZipFile(File file, int mode, Charset charset) throws IOException } Objects.requireNonNull(charset, "charset"); - this.zc = ZipCoder.get(charset); this.name = name; long t0 = System.nanoTime(); - this.res = new CleanableResource(this, file, mode); + this.res = new CleanableResource(this, ZipCoder.get(charset), file, mode); PerfCounter.getZipFileOpenTime().addElapsedTimeFrom(t0); PerfCounter.getZipFileCount().increment(); @@ -307,7 +305,7 @@ public String getComment() { if (res.zsrc.comment == null) { return null; } - return zc.toString(res.zsrc.comment); + return res.zsrc.zc.toString(res.zsrc.comment); } } @@ -338,18 +336,9 @@ private ZipEntry getEntry(String name, Function func ZipEntry entry = null; synchronized (this) { ensureOpen(); - byte[] bname = zc.getBytes(name); - int pos = res.zsrc.getEntryPos(bname, true); + int pos = res.zsrc.getEntryPos(name, true); if (pos != -1) { - entry = getZipEntry(name, bname, pos, func); - } else if (!zc.isUTF8() && !name.isEmpty() && !name.endsWith("/")) { - // non-UTF-8 charsets need to lookup again with added slash - name = name + '/'; - bname = zc.getBytes(name); - pos = res.zsrc.getEntryPos(bname, false); - if (pos != -1) { - entry = getZipEntry(name, bname, pos, func); - } + entry = getZipEntry(name, pos, func); } } return entry; @@ -371,7 +360,7 @@ private ZipEntry getEntry(String name, Function func */ public InputStream getInputStream(ZipEntry entry) throws IOException { Objects.requireNonNull(entry, "entry"); - int pos = -1; + int pos; ZipFileInputStream in; Source zsrc = res.zsrc; Set istreams = res.istreams; @@ -379,10 +368,8 @@ public InputStream getInputStream(ZipEntry entry) throws IOException { ensureOpen(); if (Objects.equals(lastEntryName, entry.name)) { pos = lastEntryPos; - } else if (!zc.isUTF8() && (entry.flag & USE_UTF8) != 0) { - pos = zsrc.getEntryPos(zc.getBytesUTF8(entry.name), false); } else { - pos = zsrc.getEntryPos(zc.getBytes(entry.name), false); + pos = zsrc.getEntryPos(entry.name, false); } if (pos == -1) { return null; @@ -528,7 +515,7 @@ public T next() { throw new NoSuchElementException(); } // each "entry" has 3 ints in table entries - return (T)getZipEntry(null, null, res.zsrc.getEntryPos(i++ * 3), gen); + return (T)getZipEntry(null, res.zsrc.getEntryPos(i++ * 3), gen); } } @@ -600,18 +587,15 @@ public boolean tryAdvance(Consumer action) { synchronized (this) { ensureOpen(); return StreamSupport.stream(new EntrySpliterator<>(0, res.zsrc.total, - pos -> getZipEntry(null, null, pos, ZipEntry::new)), false); + pos -> getZipEntry(null, pos, ZipEntry::new)), false); } } private String getEntryName(int pos) { byte[] cen = res.zsrc.cen; int nlen = CENNAM(cen, pos); - if (!zc.isUTF8() && (CENFLG(cen, pos) & USE_UTF8) != 0) { - return zc.toStringUTF8(cen, pos + CENHDR, nlen); - } else { - return zc.toString(cen, pos + CENHDR, nlen); - } + ZipCoder zc = res.zsrc.zipCoderForPos(pos); + return zc.toString(cen, pos + CENHDR, nlen); } /* @@ -647,34 +631,37 @@ private String getEntryName(int pos) { synchronized (this) { ensureOpen(); return StreamSupport.stream(new EntrySpliterator<>(0, res.zsrc.total, - pos -> (JarEntry)getZipEntry(null, null, pos, func)), false); + pos -> (JarEntry)getZipEntry(null, pos, func)), false); } } private String lastEntryName; private int lastEntryPos; - /* Checks ensureOpen() before invoke this method */ - private ZipEntry getZipEntry(String name, byte[] bname, int pos, + /* Check ensureOpen() before invoking this method */ + private ZipEntry getZipEntry(String name, int pos, Function func) { byte[] cen = res.zsrc.cen; int nlen = CENNAM(cen, pos); int elen = CENEXT(cen, pos); int clen = CENCOM(cen, pos); - int flag = CENFLG(cen, pos); - if (name == null || bname.length != nlen) { - // to use the entry name stored in cen, if the passed in name is - // (1) null, invoked from iterator, or - // (2) not equal to the name stored, a slash is appended during - // getEntryPos() search. - if (!zc.isUTF8() && (flag & USE_UTF8) != 0) { - name = zc.toStringUTF8(cen, pos + CENHDR, nlen); - } else { - name = zc.toString(cen, pos + CENHDR, nlen); + + ZipCoder zc = res.zsrc.zipCoderForPos(pos); + if (name != null) { + // only need to check for mismatch of trailing slash + if (nlen > 0 && + !name.isEmpty() && + zc.hasTrailingSlash(cen, pos + CENHDR + nlen) && + !name.endsWith("/")) + { + name += '/'; } + } else { + // invoked from iterator, use the entry name stored in cen + name = zc.toString(cen, pos + CENHDR, nlen); } ZipEntry e = func.apply(name); //ZipEntry e = new ZipEntry(name); - e.flag = flag; + e.flag = CENFLG(cen, pos); e.xdostime = CENTIM(cen, pos); e.crc = CENCRC(cen, pos); e.size = CENLEN(cen, pos); @@ -686,11 +673,7 @@ private ZipEntry getZipEntry(String name, byte[] bname, int pos, } if (clen != 0) { int start = pos + CENHDR + nlen + elen; - if (!zc.isUTF8() && (flag & USE_UTF8) != 0) { - e.comment = zc.toStringUTF8(cen, start, clen); - } else { - e.comment = zc.toString(cen, start, clen); - } + e.comment = zc.toString(cen, start, clen); } lastEntryName = e.name; lastEntryPos = pos; @@ -721,11 +704,11 @@ public int size() { Source zsrc; - CleanableResource(ZipFile zf, File file, int mode) throws IOException { + CleanableResource(ZipFile zf, ZipCoder zc, File file, int mode) throws IOException { this.cleanable = CleanerFactory.cleaner().register(zf, this); this.istreams = Collections.newSetFromMap(new WeakHashMap<>()); this.inflaterCache = new ArrayDeque<>(); - this.zsrc = Source.get(file, (mode & OPEN_DELETE) != 0, zf.zc); + this.zsrc = Source.get(file, (mode & OPEN_DELETE) != 0, zc); } void clean() { @@ -1113,7 +1096,7 @@ public JarEntry getEntry(ZipFile zip, String name, private static final int[] EMPTY_META_VERSIONS = new int[0]; private final Key key; // the key in files - private final ZipCoder zc; // zip coder used to decode/encode + private final @Stable ZipCoder zc; // zip coder used to decode/encode private int refs = 1; @@ -1412,8 +1395,6 @@ private End findEND() throws IOException { private void initCEN(int knownTotal) throws IOException { // Prefer locals for better performance during startup byte[] cen; - ZipCoder zc = this.zc; - if (knownTotal == -1) { End end = findEND(); if (end.endpos == 0) { @@ -1488,7 +1469,7 @@ private void initCEN(int knownTotal) throws IOException { if (entryPos + nlen > limit) zerror("invalid CEN header (bad header size)"); // Record the CEN offset and the name hash in our hash cell. - hash = zc.hashN(cen, entryPos, nlen); + hash = zipCoderForPos(pos).normalizedHash(cen, entryPos, nlen); hsh = (hash & 0x7fffffff) % tablelen; next = table[hsh]; table[hsh] = idx; @@ -1544,11 +1525,12 @@ private static void zerror(String msg) throws ZipException { * Returns the {@code pos} of the zip cen entry corresponding to the * specified entry name, or -1 if not found. */ - private int getEntryPos(byte[] name, boolean addSlash) { + private int getEntryPos(String name, boolean addSlash) { if (total == 0) { return -1; } - int hsh = zc.hashN(name, 0, name.length); + + int hsh = ZipCoder.normalizedHash(name); int idx = table[(hsh & 0x7fffffff) % tablelen]; // Search down the target hash chain for a entry whose @@ -1557,31 +1539,25 @@ private int getEntryPos(byte[] name, boolean addSlash) { if (getEntryHash(idx) == hsh) { // The CEN name must match the specfied one int pos = getEntryPos(idx); - byte[] cen = this.cen; - final int nlen = CENNAM(cen, pos); - int nameoff = pos + CENHDR; - - // If addSlash is true and we're using the UTF-8 zip coder, - // we'll directly test for name+/ in addition to name, - // unless name is the empty string or already ends with a - // slash - if (name.length == nlen || - (addSlash && - zc.isUTF8() && - name.length > 0 && - name.length + 1 == nlen && - cen[nameoff + nlen - 1] == '/' && - name[name.length - 1] != '/')) { - boolean matched = true; - for (int i = 0; i < name.length; i++) { - if (name[i] != cen[nameoff++]) { - matched = false; - break; - } - } - if (matched) { - return pos; + + try { + ZipCoder zc = zipCoderForPos(pos); + String entry = zc.toString(cen, pos + CENHDR, CENNAM(cen, pos)); + + // If addSlash is true we'll test for name+/ in addition to + // name, unless name is the empty string or already ends with a + // slash + int entryLen = entry.length(); + int nameLen = name.length(); + if ((entryLen == nameLen && entry.equals(name)) || + (addSlash && + nameLen + 1 == entryLen && + entry.startsWith(name) && + entry.charAt(entryLen - 1) == '/')) { + return pos; } + } catch (IllegalArgumentException iae) { + // Ignore } } idx = getEntryNext(idx); @@ -1589,6 +1565,16 @@ private int getEntryPos(byte[] name, boolean addSlash) { return -1; } + private ZipCoder zipCoderForPos(int pos) { + if (zc.isUTF8()) { + return zc; + } + if ((CENFLG(cen, pos) & USE_UTF8) != 0) { + return ZipCoder.UTF8; + } + return zc; + } + /** * Returns true if the bytes represent a non-directory name * beginning with "META-INF/", disregarding ASCII case. diff --git a/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java b/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java index 27cd71359f7..f87d24f8dd5 100644 --- a/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java +++ b/src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -132,16 +132,6 @@ public static ClassLoader appClassLoader() { PlatformClassLoader(BootClassLoader parent) { super("platform", parent, null); } - - /** - * Called by the VM to support define package for AppCDS. - * - * Shared classes are returned in ClassLoader::findLoadedClass - * that bypass the defineClass call. - */ - private Package definePackage(String pn, Module module) { - return JLA.definePackage(this, pn, module); - } } /** @@ -194,16 +184,6 @@ void appendToClassPathForInstrumentation(String path) { ucp.addFile(path); } - /** - * Called by the VM to support define package for AppCDS - * - * Shared classes are returned in ClassLoader::findLoadedClass - * that bypass the defineClass call. - */ - private Package definePackage(String pn, Module module) { - return JLA.definePackage(this, pn, module); - } - /** * Called by the VM to support define package for AppCDS */ diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java b/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java index efc3d102491..5e6dcb367f1 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleHashes.java @@ -26,18 +26,21 @@ package jdk.internal.module; import java.io.IOException; +import java.io.InputStream; import java.io.UncheckedIOException; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; -import java.nio.file.Path; +import java.lang.module.ModuleReader; +import java.lang.module.ModuleReference; +import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.TreeMap; import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.TreeMap; +import java.util.function.Supplier; /** * The result of hashing the contents of a number of module artifacts. @@ -61,8 +64,8 @@ * @param algorithm the algorithm used to create the hashes * @param nameToHash the map of module name to hash value */ - public ModuleHashes(String algorithm, Map nameToHash) { - this.algorithm = algorithm; + ModuleHashes(String algorithm, Map nameToHash) { + this.algorithm = Objects.requireNonNull(algorithm); this.nameToHash = Collections.unmodifiableMap(nameToHash); } @@ -96,54 +99,125 @@ public String algorithm() { } /** - * Computes the hash for the given file with the given message digest - * algorithm. + * Computes a hash from the names and content of a module. * + * @param reader the module reader to access the module content + * @param algorithm the name of the message digest algorithm to use + * @return the hash + * @throws IllegalArgumentException if digest algorithm is not supported * @throws UncheckedIOException if an I/O error occurs - * @throws RuntimeException if the algorithm is not available */ - public static byte[] computeHash(Path file, String algorithm) { + private static byte[] computeHash(ModuleReader reader, String algorithm) { + MessageDigest md; try { - MessageDigest md = MessageDigest.getInstance(algorithm); - - // Ideally we would just mmap the file but this consumes too much - // memory when jlink is running concurrently on very large jmods - try (FileChannel fc = FileChannel.open(file)) { - ByteBuffer bb = ByteBuffer.allocate(32*1024); - while (fc.read(bb) > 0) { - bb.flip(); - md.update(bb); - assert bb.remaining() == 0; - bb.clear(); + md = MessageDigest.getInstance(algorithm); + } catch (NoSuchAlgorithmException e) { + throw new IllegalArgumentException(e); + } + try { + byte[] buf = new byte[32*1024]; + reader.list().sorted().forEach(rn -> { + md.update(rn.getBytes(StandardCharsets.UTF_8)); + try (InputStream in = reader.open(rn).orElseThrow()) { + int n; + while ((n = in.read(buf)) > 0) { + md.update(buf, 0, n); + } + } catch (IOException ioe) { + throw new UncheckedIOException(ioe); } - } + }); + } catch (IOException ioe) { + throw new UncheckedIOException(ioe); + } + return md.digest(); + } - return md.digest(); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException(e); + /** + * Computes a hash from the names and content of a module. + * + * @param supplier supplies the module reader to access the module content + * @param algorithm the name of the message digest algorithm to use + * @return the hash + * @throws IllegalArgumentException if digest algorithm is not supported + * @throws UncheckedIOException if an I/O error occurs + */ + static byte[] computeHash(Supplier supplier, String algorithm) { + try (ModuleReader reader = supplier.get()) { + return computeHash(reader, algorithm); } catch (IOException ioe) { throw new UncheckedIOException(ioe); } } /** - * Computes the hash for every entry in the given map, returning a - * {@code ModuleHashes} to encapsulate the result. The map key is - * the entry name, typically the module name. The map value is the file - * path to the entry (module artifact). + * Computes the hash from the names and content of a set of modules. Returns + * a {@code ModuleHashes} to encapsulate the result. * + * @param mrefs the set of modules + * @param algorithm the name of the message digest algorithm to use * @return ModuleHashes that encapsulates the hashes + * @throws IllegalArgumentException if digest algorithm is not supported + * @throws UncheckedIOException if an I/O error occurs */ - public static ModuleHashes generate(Map map, String algorithm) { + static ModuleHashes generate(Set mrefs, String algorithm) { Map nameToHash = new TreeMap<>(); - for (Map.Entry entry: map.entrySet()) { - String name = entry.getKey(); - Path path = entry.getValue(); - nameToHash.put(name, computeHash(path, algorithm)); + for (ModuleReference mref : mrefs) { + try (ModuleReader reader = mref.open()) { + byte[] hash = computeHash(reader, algorithm); + nameToHash.put(mref.descriptor().name(), hash); + } catch (IOException ioe) { + throw new UncheckedIOException(ioe); + } } return new ModuleHashes(algorithm, nameToHash); } + @Override + public int hashCode() { + int h = algorithm.hashCode(); + for (Map.Entry e : nameToHash.entrySet()) { + h = h * 31 + e.getKey().hashCode(); + h = h * 31 + Arrays.hashCode(e.getValue()); + } + return h; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ModuleHashes)) + return false; + ModuleHashes other = (ModuleHashes) obj; + if (!algorithm.equals(other.algorithm) + || nameToHash.size() != other.nameToHash.size()) + return false; + for (Map.Entry e : nameToHash.entrySet()) { + String name = e.getKey(); + byte[] hash = e.getValue(); + if (!Arrays.equals(hash, other.nameToHash.get(name))) + return false; + } + return true; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(algorithm); + sb.append(" "); + nameToHash.entrySet() + .stream() + .sorted(Map.Entry.comparingByKey()) + .forEach(e -> { + sb.append(e.getKey()); + sb.append("="); + byte[] ba = e.getValue(); + for (byte b : ba) { + sb.append(String.format("%02x", b & 0xff)); + } + }); + return sb.toString(); + } + /** * This is used by jdk.internal.module.SystemModules class * generated at link time. diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java b/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java index 9b6f497fff9..cebca6fb360 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleHashesBuilder.java @@ -27,9 +27,8 @@ import java.io.PrintStream; import java.lang.module.Configuration; +import java.lang.module.ModuleReference; import java.lang.module.ResolvedModule; -import java.net.URI; -import java.nio.file.Path; import java.util.ArrayDeque; import java.util.Collections; import java.util.Deque; @@ -39,7 +38,6 @@ import java.util.Map; import java.util.Set; import java.util.function.Consumer; -import java.util.function.Function; import java.util.stream.Stream; import static java.util.stream.Collectors.*; @@ -114,27 +112,17 @@ public ModuleHashesBuilder(Configuration config, Set modules) { mods.addAll(ns); if (!ns.isEmpty()) { - Map moduleToPath = ns.stream() - .collect(toMap(Function.identity(), this::moduleToPath)); - hashes.put(mn, ModuleHashes.generate(moduleToPath, "SHA-256")); + Set mrefs = ns.stream() + .map(name -> configuration.findModule(name) + .orElseThrow(InternalError::new)) + .map(ResolvedModule::reference) + .collect(toSet()); + hashes.put(mn, ModuleHashes.generate(mrefs, "SHA-256")); } }); return hashes; } - private Path moduleToPath(String name) { - ResolvedModule rm = configuration.findModule(name).orElseThrow( - () -> new InternalError("Selected module " + name + " not on module path")); - - URI uri = rm.reference().location().get(); - Path path = Path.of(uri); - String fn = path.getFileName().toString(); - if (!fn.endsWith(".jar") && !fn.endsWith(".jmod")) { - throw new UnsupportedOperationException(path + " is not a modular JAR or jmod file"); - } - return path; - } - /* * Utility class */ diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java b/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java index 7262dbbea16..7015194169b 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleInfoExtender.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -167,7 +167,9 @@ public ModuleVisitor visitModule(String name, int flags, String version) { // ModulePackages attribute if (packages != null) { - packages.forEach(pn -> mv.visitPackage(pn.replace('.', '/'))); + packages.stream() + .sorted() + .forEach(pn -> mv.visitPackage(pn.replace('.', '/'))); } return new ModuleVisitor(Opcodes.ASM7, mv) { diff --git a/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java b/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java index 92243c6a26e..3e30e8ee53d 100644 --- a/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java +++ b/src/java.base/share/classes/jdk/internal/module/ModuleReferences.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,7 +93,7 @@ static ModuleReference newJarModule(ModuleInfo.Attributes attrs, Path file) { URI uri = file.toUri(); Supplier supplier = () -> new JarModuleReader(file, uri); - HashSupplier hasher = (a) -> ModuleHashes.computeHash(file, a); + HashSupplier hasher = (a) -> ModuleHashes.computeHash(supplier, a); return newModule(attrs, uri, supplier, patcher, hasher); } @@ -103,7 +103,7 @@ static ModuleReference newJarModule(ModuleInfo.Attributes attrs, static ModuleReference newJModModule(ModuleInfo.Attributes attrs, Path file) { URI uri = file.toUri(); Supplier supplier = () -> new JModModuleReader(file, uri); - HashSupplier hasher = (a) -> ModuleHashes.computeHash(file, a); + HashSupplier hasher = (a) -> ModuleHashes.computeHash(supplier, a); return newModule(attrs, uri, supplier, null, hasher); } diff --git a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java index c7caed8b82e..f2b9a228d8b 100644 --- a/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java +++ b/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java @@ -619,6 +619,15 @@ private void duplexCloseOutput() throws IOException { } } + // Deliver the user_canceled alert and the close notify alert. + closeNotify(useUserCanceled); + + if (!isInputShutdown()) { + bruteForceCloseInput(hasCloseReceipt); + } + } + + void closeNotify(boolean useUserCanceled) throws IOException { // Need a lock here so that the user_canceled alert and the // close_notify alert can be delivered together. int linger = getSoLinger(); @@ -633,7 +642,7 @@ private void duplexCloseOutput() throws IOException { conContext.outputRecord.recordLock.tryLock( linger, TimeUnit.SECONDS)) { try { - handleClosedNotifyAlert(useUserCanceled); + deliverClosedNotify(useUserCanceled); } finally { conContext.outputRecord.recordLock.unlock(); } @@ -687,18 +696,14 @@ private void duplexCloseOutput() throws IOException { } else { conContext.outputRecord.recordLock.lock(); try { - handleClosedNotifyAlert(useUserCanceled); + deliverClosedNotify(useUserCanceled); } finally { conContext.outputRecord.recordLock.unlock(); } } - - if (!isInputShutdown()) { - bruteForceCloseInput(hasCloseReceipt); - } } - private void handleClosedNotifyAlert( + private void deliverClosedNotify( boolean useUserCanceled) throws IOException { try { // send a user_canceled alert if needed. diff --git a/src/java.base/share/classes/sun/security/ssl/TransportContext.java b/src/java.base/share/classes/sun/security/ssl/TransportContext.java index 78bc99014ea..dc63b663ce6 100644 --- a/src/java.base/share/classes/sun/security/ssl/TransportContext.java +++ b/src/java.base/share/classes/sun/security/ssl/TransportContext.java @@ -238,7 +238,7 @@ boolean isPostHandshakeContext() { (handshakeContext instanceof PostHandshakeContext); } - // Note: close_notify is delivered as a warning alert. + // Note: Don't use this method for close_nofity, use closeNotify() instead. void warning(Alert alert) { // For initial handshaking, don't send a warning alert message to peer // if handshaker has not started. @@ -254,6 +254,33 @@ void warning(Alert alert) { } } + // Note: close_notify is delivered as a warning alert. + void closeNotify(boolean isUserCanceled) throws IOException { + // Socket transport is special because of the SO_LINGER impact. + if (transport instanceof SSLSocketImpl) { + ((SSLSocketImpl)transport).closeNotify(isUserCanceled); + } else { + // Need a lock here so that the user_canceled alert and the + // close_notify alert can be delivered together. + outputRecord.recordLock.lock(); + try { + try { + // send a user_canceled alert if needed. + if (isUserCanceled) { + warning(Alert.USER_CANCELED); + } + + // send a close_notify alert + warning(Alert.CLOSE_NOTIFY); + } finally { + outputRecord.close(); + } + } finally { + outputRecord.recordLock.unlock(); + } + } + } + SSLException fatal(Alert alert, String diagnostic) throws SSLException { return fatal(alert, diagnostic, null); @@ -501,17 +528,7 @@ private void passiveInboundClose() throws IOException { } if (needCloseNotify) { - outputRecord.recordLock.lock(); - try { - try { - // send a close_notify alert - warning(Alert.CLOSE_NOTIFY); - } finally { - outputRecord.close(); - } - } finally { - outputRecord.recordLock.unlock(); - } + closeNotify(false); } } } @@ -547,24 +564,7 @@ private void initiateOutboundClose() throws IOException { useUserCanceled = true; } - // Need a lock here so that the user_canceled alert and the - // close_notify alert can be delivered together. - outputRecord.recordLock.lock(); - try { - try { - // send a user_canceled alert if needed. - if (useUserCanceled) { - warning(Alert.USER_CANCELED); - } - - // send a close_notify alert - warning(Alert.CLOSE_NOTIFY); - } finally { - outputRecord.close(); - } - } finally { - outputRecord.recordLock.unlock(); - } + closeNotify(useUserCanceled); } // Note; HandshakeStatus.FINISHED status is retrieved in other places. diff --git a/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java b/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java index f5ffc866a68..f737545d2e1 100644 --- a/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java +++ b/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -224,8 +224,8 @@ private static Locale applyAliases(Locale loc) { if (supportedLocaleString == null) { return Collections.emptySet(); } - Set tagset = new HashSet<>(); StringTokenizer tokens = new StringTokenizer(supportedLocaleString); + Set tagset = new HashSet<>(Math.max((int)(tokens.countTokens() / 0.75f) + 1, 16)); while (tokens.hasMoreTokens()) { tagset.add(tokens.nextToken()); } diff --git a/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java b/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java index 477697e32fc..431f72e2dd8 100644 --- a/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java +++ b/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -444,8 +444,8 @@ public LocaleData getLocaleData() { if (supportedLocaleString == null) { return Collections.emptySet(); } - Set tagset = new HashSet<>(); StringTokenizer tokens = new StringTokenizer(supportedLocaleString); + Set tagset = new HashSet<>(Math.max((int)(tokens.countTokens() / 0.75f) + 1, 16)); while (tokens.hasMoreTokens()) { tagset.add(tokens.nextToken()); } diff --git a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java index bd4e2c87c3a..298269012e7 100644 --- a/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java +++ b/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java @@ -272,6 +272,9 @@ String VICTORIA[] = new String[] {"Australian Eastern Standard Time (Victoria)", "AEST", "Australian Eastern Daylight Time (Victoria)", "AEDT", "Australian Eastern Time (Victoria)", "AET"}; + String WGT[] = new String[] {"Western Greenland Time", "WGT", + "Western Greenland Summer Time", "WGST", + "Western Greenland Time", "WGT"}; String UTC[] = new String[] {"Coordinated Universal Time", "UTC", "Coordinated Universal Time", "UTC", "Coordinated Universal Time", "UTC"}; @@ -432,7 +435,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -444,9 +447,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"Western Greenland Time", "WGT", - "Western Greenland Summer Time", "WGST", - "Western Greenland Time", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -514,6 +515,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -556,7 +558,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -798,7 +800,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/java.base/share/legal/public_suffix.md b/src/java.base/share/legal/public_suffix.md index ef3fb1fc8b7..3c015a4427b 100644 --- a/src/java.base/share/legal/public_suffix.md +++ b/src/java.base/share/legal/public_suffix.md @@ -11,7 +11,7 @@ If you do not wish to use the Public Suffix List, you may remove the The Source Code of this file is available under the Mozilla Public License, v. 2.0 and is located at -https://raw.githubusercontent.com/publicsuffix/list/33c1c788decfed1052089fa27e3005fe4088dec3/public_suffix_list.dat. +https://raw.githubusercontent.com/publicsuffix/list/cbbba1d234670453df9c930dfbf510c0474d4301/public_suffix_list.dat. If a copy of the MPL was not distributed with this file, you can obtain one at https://mozilla.org/MPL/2.0/. diff --git a/src/java.base/share/man/java.1 b/src/java.base/share/man/java.1 index e3ccec2093e..a78d5a3d580 100644 --- a/src/java.base/share/man/java.1 +++ b/src/java.base/share/man/java.1 @@ -1,5 +1,5 @@ .\"t -.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -1810,7 +1810,7 @@ in the information collected. .B \f[CB]settings=\f[R]\f[I]path\f[R] Specifies the path and name of the event settings file (of type JFC). By default, the \f[CB]default.jfc\f[R] file is used, which is located in -\f[CB]JRE_HOME/lib/jfr\f[R]. +\f[CB]JAVA_HOME/lib/jfr\f[R]. This default settings file collects a predefined set of information with low overhead, so it has minimal impact on performance and can be used with recordings that run continuously. diff --git a/src/java.base/share/native/libjli/java.c b/src/java.base/share/native/libjli/java.c index dacd2525059..38ddbc03248 100644 --- a/src/java.base/share/native/libjli/java.c +++ b/src/java.base/share/native/libjli/java.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/src/java.base/unix/native/libjli/java_md_solinux.c b/src/java.base/unix/native/libjli/java_md_solinux.c index d06c8ee3552..4d666b426e3 100644 --- a/src/java.base/unix/native/libjli/java_md_solinux.c +++ b/src/java.base/unix/native/libjli/java_md_solinux.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/src/java.base/unix/native/libjli/java_md_solinux.h b/src/java.base/unix/native/libjli/java_md_solinux.h index 72fcc225b85..16b0edf8b48 100644 --- a/src/java.base/unix/native/libjli/java_md_solinux.h +++ b/src/java.base/unix/native/libjli/java_md_solinux.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java b/src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java index c48245cc0c3..de1e6742505 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/ResponseContent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -125,6 +125,7 @@ BodyParser getBodyParser(Consumer onComplete) static enum ChunkState {READING_LENGTH, READING_DATA, DONE} + static final int MAX_CHUNK_HEADER_SIZE = 2050; class ChunkedBodyParser implements BodyParser { final ByteBuffer READMORE = Utils.EMPTY_BYTEBUFFER; final Consumer onComplete; @@ -136,6 +137,8 @@ BodyParser getBodyParser(Consumer onComplete) volatile int chunklen = -1; // number of bytes in chunk volatile int bytesremaining; // number of bytes in chunk left to be read incl CRLF volatile boolean cr = false; // tryReadChunkLength has found CR + volatile int chunkext = 0; // number of bytes already read in the chunk extension + volatile int digits = 0; // number of chunkLength bytes already read volatile int bytesToConsume; // number of bytes that still need to be consumed before proceeding volatile ChunkState state = ChunkState.READING_LENGTH; // current state volatile AbstractSubscription sub; @@ -147,6 +150,26 @@ String dbgString() { return dbgTag; } + // best effort - we're assuming UTF-8 text and breaks at character boundaries + // for this debug output. Not called. + private void debugBuffer(ByteBuffer b) { + if (!debug.on()) return; + ByteBuffer printable = b.asReadOnlyBuffer(); + byte[] bytes = new byte[printable.limit() - printable.position()]; + printable.get(bytes, 0, bytes.length); + String msg = "============== accepted ==================\n"; + try { + var str = new String(bytes, "UTF-8"); + msg += str; + } catch (Exception x) { + msg += x; + x.printStackTrace(); + } + msg += "\n==========================================\n"; + debug.log(msg); + + } + @Override public void onSubscribe(AbstractSubscription sub) { if (debug.on()) @@ -158,7 +181,6 @@ public void onSubscribe(AbstractSubscription sub) { public String currentStateMessage() { return format("chunked transfer encoding, state: %s", state); } - @Override public void accept(ByteBuffer b) { if (closedExceptionally != null) { @@ -166,6 +188,7 @@ public void accept(ByteBuffer b) { debug.log("already closed: " + closedExceptionally); return; } + // debugBuffer(b); boolean completed = false; try { List out = new ArrayList<>(); @@ -221,6 +244,9 @@ public void accept(ByteBuffer b) { private int tryReadChunkLen(ByteBuffer chunkbuf) throws IOException { assert state == ChunkState.READING_LENGTH; while (chunkbuf.hasRemaining()) { + if (chunkext + digits >= MAX_CHUNK_HEADER_SIZE) { + throw new IOException("Chunk header size too long: " + (chunkext + digits)); + } int c = chunkbuf.get(); if (cr) { if (c == LF) { @@ -231,9 +257,34 @@ private int tryReadChunkLen(ByteBuffer chunkbuf) throws IOException { } if (c == CR) { cr = true; + if (digits == 0 && debug.on()) { + debug.log("tryReadChunkLen: invalid chunk header? No digits in chunkLen?"); + } + } else if (cr == false && chunkext > 0) { + // we have seen a non digit character after the chunk length. + // skip anything until CR is found. + chunkext++; + if (debug.on()) { + debug.log("tryReadChunkLen: More extraneous character after chunk length: " + c); + } } else { int digit = toDigit(c); - partialChunklen = partialChunklen * 16 + digit; + if (digit < 0) { + if (digits > 0) { + // first non-digit character after chunk length. + // skip anything until CR is found. + chunkext++; + if (debug.on()) { + debug.log("tryReadChunkLen: Extraneous character after chunk length: " + c); + } + } else { + // there should be at list one digit in chunk length + throw new IOException("Illegal character in chunk size: " + c); + } + } else { + digits++; + partialChunklen = partialChunklen * 16 + digit; + } } } return -1; @@ -286,6 +337,7 @@ ByteBuffer tryReadOneHunk(ByteBuffer chunk) throws IOException { + " (remaining in buffer:"+chunk.remaining()+")"); int clen = chunklen = tryReadChunkLen(chunk); if (clen == -1) return READMORE; + digits = chunkext = 0; if (debug.on()) debug.log("Got chunk len %d", clen); cr = false; partialChunklen = 0; unfulfilled = bytesremaining = clen; @@ -354,6 +406,7 @@ ByteBuffer tryReadOneHunk(ByteBuffer chunk) throws IOException { chunklen = -1; partialChunklen = 0; cr = false; + digits = chunkext = 0; state = ChunkState.READING_LENGTH; if (debug.on()) debug.log("Ready to read next chunk"); } @@ -395,7 +448,7 @@ private int toDigit(int b) throws IOException { if (b >= 0x61 && b <= 0x66) { return b - 0x61 + 10; } - throw new IOException("Invalid chunk header byte " + b); + return -1; } } diff --git a/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java b/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java index b6d5bb93fa6..b65294a8367 100644 --- a/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java +++ b/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java @@ -389,10 +389,10 @@ void incoming(Http2Frame frame) throws IOException { if (hframe.endHeaders()) { Log.logTrace("handling response (streamid={0})", streamid); handleResponse(); - if (hframe.getFlag(HeaderFrame.END_STREAM)) { - if (debug.on()) debug.log("handling END_STREAM: %d", streamid); - receiveDataFrame(new DataFrame(streamid, DataFrame.END_STREAM, List.of())); - } + } + if (hframe.getFlag(HeaderFrame.END_STREAM)) { + if (debug.on()) debug.log("handling END_STREAM: %d", streamid); + receiveDataFrame(new DataFrame(streamid, DataFrame.END_STREAM, List.of())); } } else if (frame instanceof DataFrame) { receiveDataFrame((DataFrame)frame); diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java index 2854f8693ed..b9e3b016132 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java @@ -194,6 +194,17 @@ public Symbol getGenericSignature() { // bytecode accessors + /** See if address is in the Method's bytecodes */ + public boolean isAddressInMethod(Address bcp) { + Address bytecodeStart = getAddress().addOffsetTo(bytecodeOffset); + Address bytecodeEnd = bytecodeStart.addOffsetTo(getCodeSize() - 1); + if (bcp.greaterThanOrEqual(bytecodeStart) && bcp.lessThanOrEqual(bytecodeEnd)) { + return true; + } else { + return false; + } + } + /** Get a bytecode or breakpoint at the given bci */ public int getBytecodeOrBPAt(int bci) { return getAddress().getJByteAt(bytecodeOffset + bci) & 0xFF; @@ -296,7 +307,8 @@ public int getLineNumberFromBCI(int bci) { } if (Assert.ASSERTS_ENABLED) { - Assert.that(bci == 0 || 0 <= bci && bci < getCodeSize(), "illegal bci"); + Assert.that(0 <= bci && bci < getCodeSize(), + "illegal bci(" + bci + ") codeSize(" + getCodeSize() + ")"); } int bestBCI = 0; int bestLine = -1; diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java index a599a171a57..65ba5c29ebe 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ public StackFrameInfo stackFrameAt(int index) { public void dumpStack(int maxDepth) { if (!thread.isJavaThread()) { - System.out.println("dumpStack: not java Thread returning"); + System.out.println("dumpStack: not java Thread."); return; } try { diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java index 5c8d9d68dc4..3f7d923a564 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java @@ -103,6 +103,10 @@ public Frame getCurrentFrameGuess(JavaThread thread, Address addr) { } if (guesser.getPC() == null) { return new X86Frame(guesser.getSP(), guesser.getFP()); + } else if (VM.getVM().getInterpreter().contains(guesser.getPC())) { + // pass the value of R13 which contains the bcp for the top level frame + Address bcp = context.getRegisterAsAddress(AMD64ThreadContext.R13); + return new X86Frame(guesser.getSP(), guesser.getFP(), guesser.getPC(), null, bcp); } else { return new X86Frame(guesser.getSP(), guesser.getFP(), guesser.getPC()); } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java index bc5869fb67a..f6975d836c1 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java @@ -107,6 +107,10 @@ public Frame getCurrentFrameGuess(JavaThread thread, Address addr) { } if (guesser.getPC() == null) { return new X86Frame(guesser.getSP(), guesser.getFP()); + } else if (VM.getVM().getInterpreter().contains(guesser.getPC())) { + // pass the value of R13 which contains the bcp for the top level frame + Address bcp = context.getRegisterAsAddress(AMD64ThreadContext.R13); + return new X86Frame(guesser.getSP(), guesser.getFP(), guesser.getPC(), null, bcp); } else { return new X86Frame(guesser.getSP(), guesser.getFP(), guesser.getPC()); } diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java index 511bade768a..2eabb4b4c11 100644 --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java @@ -444,17 +444,23 @@ public int getInterpreterFrameBCI() { // FIXME: this is not atomic with respect to GC and is unsuitable // for use in a non-debugging, or reflective, system. Need to // figure out how to express this. + + Address methodHandle = addressOfInterpreterFrameMethod().getAddressAt(0); + Method method = (Method)Metadata.instantiateWrapperFor(methodHandle); Address bcp = addressOfInterpreterFrameBCX().getAddressAt(0); - // If we are in the top level frame then the bcp may have been set for us. If so then let it - // take priority. If we are in a top level interpreter frame, the bcp is live in R13 (on x86) + // If we are in the top level frame then the bcp may have been set for us. If so then let it + // take priority. If we are in a top level interpreter frame, the bcp is live in R13 (on x86_64) // and not saved in the BCX stack slot. if (live_bcp != null) { - bcp = live_bcp; + // Only use live_bcp if it points within the Method's bytecodes. Sometimes R13 is used + // for scratch purposes and is not a valid BCP. If it is not valid, then we stick with + // the bcp stored in the frame, which R13 should have been flushed to. + if (method.getConstMethod().isAddressInMethod(live_bcp)) { + bcp = live_bcp; + } } - Address methodHandle = addressOfInterpreterFrameMethod().getAddressAt(0); - Method method = (Method)Metadata.instantiateWrapperFor(methodHandle); return bcpToBci(bcp, method); } diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java index d5f7538e8ea..f8f7311bcb7 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java +++ b/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java @@ -839,7 +839,6 @@ static void signAppBundle( args.addAll(Arrays.asList("codesign", "--timestamp", "--options", "runtime", - "--deep", "--force", "-s", signingIdentity, // sign with this key "--prefix", identifierPrefix, @@ -884,7 +883,6 @@ static void signAppBundle( args.addAll(Arrays.asList("codesign", "--timestamp", "--options", "runtime", - "--deep", "--force", "-s", signingIdentity, "-vvvv")); diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ApplicationLayout.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ApplicationLayout.java index 48a9fb7e196..ad7d00e5e01 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ApplicationLayout.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ApplicationLayout.java @@ -33,7 +33,7 @@ */ public final class ApplicationLayout implements PathGroup.Facade { enum PathRole { - RUNTIME, APP, LAUNCHERS, DESKTOP, APP_MODS, DLLS + RUNTIME, APP, LAUNCHERS, DESKTOP, APP_MODS, DLLS, RELEASE } ApplicationLayout(Map paths) { @@ -96,6 +96,13 @@ public Path destktopIntegrationDirectory() { return pathGroup().getPath(PathRole.DESKTOP); } + /** + * Path to release file in the Java runtime directory. + */ + public Path runtimeRelease() { + return pathGroup().getPath(PathRole.RELEASE); + } + static ApplicationLayout linuxAppImage() { return new ApplicationLayout(Map.of( PathRole.LAUNCHERS, Path.of("bin"), @@ -103,7 +110,8 @@ static ApplicationLayout linuxAppImage() { PathRole.RUNTIME, Path.of("lib/runtime"), PathRole.DESKTOP, Path.of("lib"), PathRole.DLLS, Path.of("lib"), - PathRole.APP_MODS, Path.of("lib/app/mods") + PathRole.APP_MODS, Path.of("lib/app/mods"), + PathRole.RELEASE, Path.of("lib/runtime/release") )); } @@ -114,7 +122,8 @@ static ApplicationLayout windowsAppImage() { PathRole.RUNTIME, Path.of("runtime"), PathRole.DESKTOP, Path.of(""), PathRole.DLLS, Path.of(""), - PathRole.APP_MODS, Path.of("app/mods") + PathRole.APP_MODS, Path.of("app/mods"), + PathRole.RELEASE, Path.of("runtime/release") )); } @@ -125,7 +134,8 @@ static ApplicationLayout macAppImage() { PathRole.RUNTIME, Path.of("Contents/runtime"), PathRole.DESKTOP, Path.of("Contents/Resources"), PathRole.DLLS, Path.of("Contents/MacOS"), - PathRole.APP_MODS, Path.of("Contents/app/mods") + PathRole.APP_MODS, Path.of("Contents/app/mods"), + PathRole.RELEASE, Path.of("Contents/runtime/Contents/Home/release") )); } diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Arguments.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Arguments.java index 3e3f4074eab..93f775d0952 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Arguments.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Arguments.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -170,6 +170,11 @@ public Arguments(String[] args) { setOptionValue("arguments", arguments); }), + JLINK_OPTIONS ("jlink-options", OptionCategories.PROPERTY, () -> { + List options = getArgumentList(popArg()); + setOptionValue("jlink-options", options); + }), + ICON ("icon", OptionCategories.PROPERTY), COPYRIGHT ("copyright", OptionCategories.PROPERTY), @@ -264,6 +269,7 @@ public Arguments(String[] args) { MODULE_PATH ("module-path", "p", OptionCategories.MODULAR), BIND_SERVICES ("bind-services", OptionCategories.PROPERTY, () -> { + showDeprecation("bind-services"); setOptionValue("bind-services", true); }), @@ -579,7 +585,11 @@ private void validateArguments() throws PackagerException { CLIOptions.PREDEFINED_RUNTIME_IMAGE.getIdWithPrefix(), CLIOptions.BIND_SERVICES.getIdWithPrefix()); } - + if (allOptions.contains(CLIOptions.JLINK_OPTIONS)) { + throw new PackagerException("ERR_MutuallyExclusiveOptions", + CLIOptions.PREDEFINED_RUNTIME_IMAGE.getIdWithPrefix(), + CLIOptions.JLINK_OPTIONS.getIdWithPrefix()); + } } if (hasMainJar && hasMainModule) { throw new PackagerException("ERR_BothMainJarAndModule"); @@ -809,4 +819,8 @@ private String getMainClassFromManifest() { return null; } + private static void showDeprecation(String option) { + Log.error(MessageFormat.format(I18N.getString("warning.deprecation"), + option)); + } } diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DeployParams.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DeployParams.java index da9ff0a8317..9a77b103f81 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DeployParams.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DeployParams.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -315,7 +315,8 @@ boolean isTargetAppImage() { StandardBundlerParam.MODULE_PATH.getID(), StandardBundlerParam.ADD_MODULES.getID(), StandardBundlerParam.LIMIT_MODULES.getID(), - StandardBundlerParam.FILE_ASSOCIATIONS.getID() + StandardBundlerParam.FILE_ASSOCIATIONS.getID(), + StandardBundlerParam.JLINK_OPTIONS.getID() )); @SuppressWarnings("unchecked") diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DottedVersion.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DottedVersion.java index 8ef77f3cb4a..13da1350a9d 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DottedVersion.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DottedVersion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -137,6 +137,10 @@ public String toString() { return value; } + int[] getComponents() { + return components; + } + final private int[] components; final private String value; final private boolean greedy; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JLinkBundlerHelper.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JLinkBundlerHelper.java index dac359c1170..13ef367be29 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JLinkBundlerHelper.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JLinkBundlerHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -145,6 +145,8 @@ static void execute(Map params, StandardBundlerParam.ADD_MODULES.fetchFrom(params); Set limitModules = StandardBundlerParam.LIMIT_MODULES.fetchFrom(params); + List options = + StandardBundlerParam.JLINK_OPTIONS.fetchFrom(params); Path outputDir = imageBuilder.getRuntimeRoot(); File mainJar = getMainJar(params); ModFile.ModType mainJarType = ModFile.ModType.Unknown; @@ -181,7 +183,7 @@ static void execute(Map params, } runJLink(outputDir, modulePath, modules, limitModules, - new HashMap(), bindServices); + options, bindServices); imageBuilder.prepareApplicationFiles(params); } @@ -316,7 +318,7 @@ private static ModuleFinder createModuleFinder(Collection modulePath) { private static void runJLink(Path output, List modulePath, Set modules, Set limitModules, - HashMap user, boolean bindServices) + List options, boolean bindServices) throws PackagerException { // This is just to ensure jlink is given a non-existant directory @@ -342,20 +344,19 @@ private static void runJLink(Path output, List modulePath, args.add("--limit-modules"); args.add(getStringList(limitModules)); } - if (user != null && !user.isEmpty()) { - for (Map.Entry entry : user.entrySet()) { - args.add(entry.getKey()); - args.add(entry.getValue()); - } - } else { - args.add("--strip-native-commands"); - args.add("--strip-debug"); - args.add("--no-man-pages"); - args.add("--no-header-files"); - if (bindServices) { - args.add("--bind-services"); + if (options != null) { + for (String option : options) { + if (option.startsWith("--output") || + option.startsWith("--add-modules") || + option.startsWith("--module-path")) { + throw new PackagerException("error.blocked.option", option); + } + args.add(option); } } + if (bindServices) { + args.add("--bind-services"); + } StringWriter writer = new StringWriter(); PrintWriter pw = new PrintWriter(writer); diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/OverridableResource.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/OverridableResource.java index 9ce3354f10e..edfb6a9608c 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/OverridableResource.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/OverridableResource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,18 +24,28 @@ */ package jdk.incubator.jpackage.internal; -import java.io.*; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.text.MessageFormat; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; import static jdk.incubator.jpackage.internal.StandardBundlerParam.RESOURCE_DIR; import jdk.incubator.jpackage.internal.resources.ResourceLocator; + /** * Resource file that may have the default value supplied by jpackage. It can be * overridden by a file from resource directory set with {@code --resource-dir} @@ -134,13 +144,39 @@ OverridableResource setExternal(File v) { return setExternal(toPath(v)); } - Source saveToFile(Path dest) throws IOException { - for (var source: sources) { - if (source.getValue().apply(dest)) { - return source.getKey(); + Source saveToStream(OutputStream dest) throws IOException { + if (dest == null) { + return sendToConsumer(null); + } + return sendToConsumer(new ResourceConsumer() { + @Override + public Path publicName() { + throw new UnsupportedOperationException(); + } + + @Override + public void consume(InputStream in) throws IOException { + in.transferTo(dest); } + }); + } + + Source saveToFile(Path dest) throws IOException { + if (dest == null) { + return sendToConsumer(null); } - return null; + return sendToConsumer(new ResourceConsumer() { + @Override + public Path publicName() { + return dest.getFileName(); + } + + @Override + public void consume(InputStream in) throws IOException { + Files.createDirectories(dest.getParent()); + Files.copy(in, dest, StandardCopyOption.REPLACE_EXISTING); + } + }); } Source saveToFile(File dest) throws IOException { @@ -157,6 +193,15 @@ static OverridableResource createResource(String defaultName, RESOURCE_DIR.fetchFrom(params)); } + private Source sendToConsumer(ResourceConsumer consumer) throws IOException { + for (var source: sources) { + if (source.getValue().apply(consumer)) { + return source.getKey(); + } + } + return null; + } + private String getPrintableCategory() { if (category != null) { return String.format("[%s]", category); @@ -164,7 +209,7 @@ private String getPrintableCategory() { return ""; } - private boolean useExternal(Path dest) throws IOException { + private boolean useExternal(ResourceConsumer dest) throws IOException { boolean used = externalPath != null && Files.exists(externalPath); if (used && dest != null) { Log.verbose(MessageFormat.format(I18N.getString( @@ -179,7 +224,7 @@ private boolean useExternal(Path dest) throws IOException { return used; } - private boolean useResourceDir(Path dest) throws IOException { + private boolean useResourceDir(ResourceConsumer dest) throws IOException { boolean used = false; if (dest == null && publicName == null) { @@ -187,7 +232,7 @@ private boolean useResourceDir(Path dest) throws IOException { } final Path resourceName = Optional.ofNullable(publicName).orElseGet( - () -> dest.getFileName()); + () -> dest.publicName()); if (resourceDir != null) { final Path customResource = resourceDir.resolve(resourceName); @@ -213,14 +258,14 @@ private boolean useResourceDir(Path dest) throws IOException { return used; } - private boolean useDefault(Path dest) throws IOException { + private boolean useDefault(ResourceConsumer dest) throws IOException { boolean used = defaultName != null; if (used && dest != null) { final Path resourceName = Optional .ofNullable(logPublicName) .orElse(Optional .ofNullable(publicName) - .orElseGet(() -> dest.getFileName())); + .orElseGet(() -> dest.publicName())); Log.verbose(MessageFormat.format( I18N.getString("message.using-default-resource"), defaultName, getPrintableCategory(), resourceName)); @@ -232,7 +277,7 @@ private boolean useDefault(Path dest) throws IOException { return used; } - private static List substitute(Stream lines, + private static Stream substitute(Stream lines, Map substitutionData) { return lines.map(line -> { String result = line; @@ -241,7 +286,7 @@ private boolean useDefault(Path dest) throws IOException { entry.getValue()).orElse("")); } return result; - }).collect(Collectors.toList()); + }); } private static Path toPath(File v) { @@ -251,17 +296,20 @@ private static Path toPath(File v) { return null; } - private void processResourceStream(InputStream rawResource, Path dest) - throws IOException { + private void processResourceStream(InputStream rawResource, + ResourceConsumer dest) throws IOException { if (substitutionData == null) { - Files.createDirectories(dest.getParent()); - Files.copy(rawResource, dest, StandardCopyOption.REPLACE_EXISTING); + dest.consume(rawResource); } else { // Utf8 in and out try (BufferedReader reader = new BufferedReader( new InputStreamReader(rawResource, StandardCharsets.UTF_8))) { - Files.createDirectories(dest.getParent()); - Files.write(dest, substitute(reader.lines(), substitutionData)); + String data = substitute(reader.lines(), substitutionData).collect( + Collectors.joining("\n")); + try (InputStream in = new ByteArrayInputStream(data.getBytes( + StandardCharsets.UTF_8))) { + dest.consume(in); + } } } } @@ -292,7 +340,12 @@ private SourceHandler getHandler(Source sourceType) { private List> sources; @FunctionalInterface - static interface SourceHandler { - public boolean apply(Path dest) throws IOException; + private static interface SourceHandler { + public boolean apply(ResourceConsumer dest) throws IOException; + } + + private static interface ResourceConsumer { + public Path publicName(); + public void consume(InputStream in) throws IOException; } } diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/StandardBundlerParam.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/StandardBundlerParam.java index c62ef7128ad..20eeffa76f4 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/StandardBundlerParam.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/StandardBundlerParam.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,6 +70,11 @@ private static final String JAVABASEJMOD = "java.base.jmod"; private final static String DEFAULT_VERSION = "1.0"; private final static String DEFAULT_RELEASE = "1"; + private final static String[] DEFAULT_JLINK_OPTIONS = { + "--strip-native-commands", + "--strip-debug", + "--no-man-pages", + "--no-header-files"}; StandardBundlerParam(String id, Class valueType, Function, T> defaultValueFunction, @@ -479,6 +484,14 @@ (s, p) -> new LinkedHashSet<>(Arrays.asList(s.split(","))) ); + @SuppressWarnings("unchecked") + static final StandardBundlerParam> JLINK_OPTIONS = + new StandardBundlerParam<>( + Arguments.CLIOptions.JLINK_OPTIONS.getId(), + (Class>) (Object) List.class, + p -> Arrays.asList(DEFAULT_JLINK_OPTIONS), + (s, p) -> null); + @SuppressWarnings("unchecked") static final BundlerParamInfo> LIMIT_MODULES = new StandardBundlerParam<>( diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ValidOptions.java b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ValidOptions.java index 97db03d629d..5581ff47f60 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ValidOptions.java +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ValidOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,6 +85,7 @@ options.put(CLIOptions.JAVA_OPTIONS.getId(), USE.LAUNCHER); options.put(CLIOptions.ADD_LAUNCHER.getId(), USE.LAUNCHER); options.put(CLIOptions.BIND_SERVICES.getId(), USE.LAUNCHER); + options.put(CLIOptions.JLINK_OPTIONS.getId(), USE.LAUNCHER); options.put(CLIOptions.LICENSE_FILE.getId(), USE.INSTALL); options.put(CLIOptions.INSTALL_DIR.getId(), USE.INSTALL); diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources.properties b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources.properties index cad427b54ad..aacf507c139 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources.properties +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -107,6 +107,12 @@ Generic Options:\n\ \ --bind-services \n\ \ Pass on --bind-services option to jlink (which will link in \n\ \ service provider modules and their dependences) \n\ +\ This option is deprecated. Use "--jlink-options" option instead. \n\ +\ --jlink-options \n\ +\ A space separated list of options to pass to jlink \n\ +\ If not specified, defaults to "--strip-native-commands \n\ +\ --strip-debug --no-man-pages --no-header-files" \n\ +\ This option can be used multiple times.\n\ \ --runtime-image \n\ \ Path of the predefined runtime image that will be copied into\n\ \ the application image\n\ diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources.properties b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources.properties index 912992942e6..9c24b568f3d 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources.properties +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -63,9 +63,11 @@ error.tool-not-found.advice=Please install {0} error.tool-old-version=Can not find {0} {1} or newer error.tool-old-version.advice=Please install {0} {1} or newer error.jlink.failed=jlink failed with: {0} +error.blocked.option=jlink option [{0}] is not permitted in --jlink-options warning.module.does.not.exist=Module [{0}] does not exist warning.no.jdk.modules.found=Warning: No JDK Modules found +warning.deprecation=Warning: Option "{0}" is deprecated and may be removed in a future release MSG_BundlerFailed=Error: Bundler "{1}" ({0}) failed to produce a package MSG_BundlerConfigException=Bundler {0} skipped because of a configuration problem: {1} \n\ diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties index efbb42c0cfb..e6220367e03 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -63,9 +63,11 @@ error.tool-not-found.advice={0}\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\ error.tool-old-version={0} {1}\u4EE5\u964D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 error.tool-old-version.advice={0} {1}\u4EE5\u964D\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3057\u3066\u304F\u3060\u3055\u3044 error.jlink.failed=jlink\u304C\u6B21\u3067\u5931\u6557\u3057\u307E\u3057\u305F: {0} +error.blocked.option=jlink option [{0}] is not permitted in --jlink-options warning.module.does.not.exist=\u30E2\u30B8\u30E5\u30FC\u30EB[{0}]\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 warning.no.jdk.modules.found=\u8B66\u544A: JDK\u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +warning.deprecation=Warning: Option "{0}" is deprecated and may be removed in a future release MSG_BundlerFailed=\u30A8\u30E9\u30FC: \u30D0\u30F3\u30C9\u30E9"{1}" ({0})\u304C\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u751F\u6210\u306B\u5931\u6557\u3057\u307E\u3057\u305F MSG_BundlerConfigException=\u69CB\u6210\u306E\u554F\u984C\u306E\u305F\u3081\u3001\u30D0\u30F3\u30C9\u30E9{0}\u304C\u30B9\u30AD\u30C3\u30D7\u3055\u308C\u307E\u3057\u305F: {1} \n\u6B21\u306E\u4FEE\u6B63\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044: {2} diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties index 049e85f88da..ee5640eee70 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties +++ b/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -63,9 +63,11 @@ error.tool-not-found.advice=\u8BF7\u5B89\u88C5 {0} error.tool-old-version=\u627E\u4E0D\u5230 {0} {1}\u6216\u66F4\u65B0\u7248\u672C error.tool-old-version.advice=\u8BF7\u5B89\u88C5 {0} {1}\u6216\u66F4\u65B0\u7248\u672C error.jlink.failed=jlink \u5931\u8D25\uFF0C\u51FA\u73B0 {0} +error.blocked.option=jlink option [{0}] is not permitted in --jlink-options warning.module.does.not.exist=\u6A21\u5757 [{0}] \u4E0D\u5B58\u5728 warning.no.jdk.modules.found=\u8B66\u544A: \u672A\u627E\u5230 JDK \u6A21\u5757 +warning.deprecation=Warning: Option "{0}" is deprecated and may be removed in a future release MSG_BundlerFailed=\u9519\u8BEF\uFF1A\u6253\u5305\u7A0B\u5E8F "{1}" ({0}) \u65E0\u6CD5\u751F\u6210\u7A0B\u5E8F\u5305 MSG_BundlerConfigException=\u7531\u4E8E\u914D\u7F6E\u95EE\u9898, \u8DF3\u8FC7\u4E86\u6253\u5305\u7A0B\u5E8F{0}: {1} \n\u4FEE\u590D\u5EFA\u8BAE: {2} diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/ExecutableRebrander.java b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/ExecutableRebrander.java new file mode 100644 index 00000000000..b9628bf1eac --- /dev/null +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/ExecutableRebrander.java @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.incubator.jpackage.internal; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Properties; +import java.util.ResourceBundle; +import static jdk.incubator.jpackage.internal.OverridableResource.createResource; +import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.incubator.jpackage.internal.StandardBundlerParam.COPYRIGHT; +import static jdk.incubator.jpackage.internal.StandardBundlerParam.DESCRIPTION; +import static jdk.incubator.jpackage.internal.StandardBundlerParam.ICON; +import static jdk.incubator.jpackage.internal.StandardBundlerParam.TEMP_ROOT; +import static jdk.incubator.jpackage.internal.StandardBundlerParam.VENDOR; +import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; + + +final class ExecutableRebrander { + private static final ResourceBundle I18N = ResourceBundle.getBundle( + "jdk.incubator.jpackage.internal.resources.WinResources"); + + private static final String LAUNCHER_PROPERTIES_TEMPLATE = + "WinLauncher.template"; + + private static final String INSTALLER_PROPERTIES_TEMPLATE = + "WinInstaller.template"; + + private static final String INSTALLER_PROPERTIES_RESOURE_DIR_ID = + "WinInstaller.properties"; + + + void rebrandInstaller(Map params, Path target) + throws IOException { + if (!target.isAbsolute()) { + rebrandInstaller(params, target.toAbsolutePath()); + return; + } + rebrandExecutable(params, target, (resourceLock) -> { + rebrandProperties(resourceLock, createResource( + INSTALLER_PROPERTIES_TEMPLATE, params).setPublicName( + INSTALLER_PROPERTIES_RESOURE_DIR_ID), + createSubstituteData(params), target); + }); + } + + void rebrandLauncher(Map params, Path icon, + Path target) throws IOException { + if (!target.isAbsolute() || (icon != null && !icon.isAbsolute())) { + Path absIcon = null; + if (icon != null) { + absIcon = icon.toAbsolutePath(); + } + rebrandLauncher(params, absIcon, target.toAbsolutePath()); + return; + } + rebrandExecutable(params, target, (resourceLock) -> { + rebrandProperties(resourceLock, createResource( + LAUNCHER_PROPERTIES_TEMPLATE, params).setPublicName( + APP_NAME.fetchFrom(params) + ".properties"), + createSubstituteData(params), target); + + if (icon != null) { + iconSwap(resourceLock, icon.toString()); + } + }); + } + + ExecutableRebrander addAction(UpdateResourceAction action) { + if (extraActions == null) { + extraActions = new ArrayList<>(); + } + extraActions.add(action); + return this; + } + + private void rebrandExecutable(Map params, + Path target, UpdateResourceAction action) throws IOException { + try { + String tempDirectory = TEMP_ROOT.fetchFrom(params).getAbsolutePath(); + if (WindowsDefender.isThereAPotentialWindowsDefenderIssue( + tempDirectory)) { + Log.verbose(MessageFormat.format(I18N.getString( + "message.potential.windows.defender.issue"), + tempDirectory)); + } + + target.toFile().setWritable(true, true); + + long resourceLock = lockResource(target.toString()); + if (resourceLock == 0) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.lock-resource"), target)); + } + + try { + action.editResource(resourceLock); + if (extraActions != null) { + for (UpdateResourceAction extraAction: extraActions) { + extraAction.editResource(resourceLock); + } + } + } finally { + if (resourceLock != 0) { + unlockResource(resourceLock); + } + } + } finally { + target.toFile().setReadOnly(); + } + } + + @FunctionalInterface + static interface UpdateResourceAction { + public void editResource(long resourceLock) throws IOException; + } + + private static String getFixedFileVersion(String value) { + int[] versionComponents = DottedVersion.greedy(value).getComponents(); + int addComponentsCount = 4 - versionComponents.length; + if (addComponentsCount > 0) { + StringBuilder sb = new StringBuilder(value); + do { + sb.append('.'); + sb.append(0); + } while (--addComponentsCount > 0); + return sb.toString(); + } + return value; + } + + private Map createSubstituteData( + Map params) { + Map data = new HashMap<>(); + + String fixedFileVersion = getFixedFileVersion(VERSION.fetchFrom(params)); + + // mapping Java parameters in strings for version resource + validateValueAndPut(data, "COMPANY_NAME", VENDOR, params); + validateValueAndPut(data, "FILE_DESCRIPTION", DESCRIPTION, params); + validateValueAndPut(data, "FILE_VERSION", VERSION, params); + validateValueAndPut(data, "LEGAL_COPYRIGHT", COPYRIGHT, params); + validateValueAndPut(data, "PRODUCT_NAME", APP_NAME, params); + data.put("FIXEDFILEINFO_FILE_VERSION", fixedFileVersion); + + return data; + } + + private void rebrandProperties(long resourceLock, OverridableResource properties, + Map data, Path target) throws IOException { + + String targetExecutableName = target.getFileName().toString(); + data.put("INTERNAL_NAME", targetExecutableName); + data.put("ORIGINAL_FILENAME", targetExecutableName); + + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + properties + .setSubstitutionData(data) + .setCategory(I18N.getString("resource.executable-properties-template")) + .saveToStream(buffer); + + final List propList = new ArrayList<>(); + try (Reader reader = new InputStreamReader(new ByteArrayInputStream( + buffer.toByteArray()), StandardCharsets.UTF_8)) { + final Properties configProp = new Properties(); + configProp.load(reader); + configProp.forEach((k, v) -> { + propList.add(k.toString()); + propList.add(v.toString()); + }); + } + + if (versionSwap(resourceLock, propList.toArray(String[]::new)) != 0) { + throw new RuntimeException(MessageFormat.format( + I18N.getString("error.version-swap"), target)); + } + } + + private static void validateValueAndPut( + Map data, String key, + BundlerParamInfo param, + Map params) { + String value = param.fetchFrom(params); + if (value.contains("\r") || value.contains("\n")) { + Log.error("Configuration Parameter " + param.getID() + + " contains multiple lines of text, ignore it"); + data.put(key, ""); + return; + } + data.put(key, value); + } + + private List extraActions; + + static { + System.loadLibrary("jpackage"); + } + + private static native long lockResource(String executable); + + private static native void unlockResource(long resourceLock); + + private static native int iconSwap(long resourceLock, String iconTarget); + + private static native int versionSwap(long resourceLock, String[] executableProperties); +} diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinExeBundler.java b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinExeBundler.java index 6130b0c3c5e..3723e119c33 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinExeBundler.java +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinExeBundler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ @Override public String getName() { - return getString("exe.bundler.name"); + return I18N.getString("exe.bundler.name"); } @Override @@ -117,48 +117,45 @@ public File bundle(Map params, File outdir) .setEnvironmentVariable("JpMsiFile", msi.getAbsolutePath().toString()) .run(params); - return buildEXE(msi, outdir); + return buildEXE(params, msi, outdir); } catch (IOException ex) { Log.verbose(ex); throw new PackagerException(ex); } } - private File buildEXE(File msi, File outdir) - throws IOException { + private File buildEXE(Map params, File msi, + File outdir) throws IOException { Log.verbose(MessageFormat.format( - getString("message.outputting-to-location"), + I18N.getString("message.outputting-to-location"), outdir.getAbsolutePath())); // Copy template msi wrapper next to msi file - String exePath = msi.getAbsolutePath(); - exePath = exePath.substring(0, exePath.lastIndexOf('.')) + ".exe"; + final Path exePath = IOUtils.replaceSuffix(msi.toPath(), ".exe"); try (InputStream is = OverridableResource.readDefault(EXE_WRAPPER_NAME)) { - Files.copy(is, Path.of(exePath)); + Files.copy(is, exePath); } - // Embed msi in msi wrapper exe. - embedMSI(exePath, msi.getAbsolutePath()); + + new ExecutableRebrander().addAction((resourceLock) -> { + // Embed msi in msi wrapper exe. + embedMSI(resourceLock, msi.getAbsolutePath()); + }).rebrandInstaller(params, exePath); Path dstExePath = Paths.get(outdir.getAbsolutePath(), - Path.of(exePath).getFileName().toString()); + exePath.getFileName().toString()); Files.deleteIfExists(dstExePath); - Files.copy(Path.of(exePath), dstExePath); + Files.copy(exePath, dstExePath); Log.verbose(MessageFormat.format( - getString("message.output-location"), + I18N.getString("message.output-location"), outdir.getAbsolutePath())); return dstExePath.toFile(); } - private static String getString(String key) - throws MissingResourceException { - return I18N.getString(key); - } - private final WinMsiBundler msiBundler = new WinMsiBundler(); - private static native int embedMSI(String exePath, String msiPath); + private static native int embedMSI(long resourceLock, String msiPath); } diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsAppImageBuilder.java b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsAppImageBuilder.java index 6634ac3e81d..48a991efd47 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsAppImageBuilder.java +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsAppImageBuilder.java @@ -26,49 +26,28 @@ package jdk.incubator.jpackage.internal; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.UncheckedIOException; -import java.io.Writer; -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.nio.charset.StandardCharsets; +import java.io.Reader; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.nio.file.attribute.PosixFilePermission; import java.text.MessageFormat; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Properties; import java.util.ResourceBundle; -import java.util.Set; -import java.util.concurrent.atomic.AtomicReference; -import java.util.regex.Pattern; -import java.util.stream.Stream; import static jdk.incubator.jpackage.internal.OverridableResource.createResource; import static jdk.incubator.jpackage.internal.StandardBundlerParam.*; public class WindowsAppImageBuilder extends AbstractAppImageBuilder { - - static { - System.loadLibrary("jpackage"); - } - private static final ResourceBundle I18N = ResourceBundle.getBundle( "jdk.incubator.jpackage.internal.resources.WinResources"); - private final static String LIBRARY_NAME = "applauncher.dll"; - - private final static String TEMPLATE_APP_ICON ="java48.ico"; - - private static final String EXECUTABLE_PROPERTIES_TEMPLATE = - "WinLauncher.template"; + private static final String TEMPLATE_APP_ICON ="java48.ico"; private final Path root; private final Path appDir; @@ -77,13 +56,6 @@ private final Path mdir; private final Path binDir; - public static final BundlerParamInfo REBRAND_EXECUTABLE = - new WindowsBundlerParam<>( - "win.launcher.rebrand", - Boolean.class, - params -> Boolean.TRUE, - (s, p) -> Boolean.valueOf(s)); - public static final BundlerParamInfo ICON_ICO = new StandardBundlerParam<>( "icon.ico", @@ -150,16 +122,6 @@ public static String getLauncherCfgName( return "app/" + APP_NAME.fetchFrom(params) +".cfg"; } - private File getConfig_ExecutableProperties( - Map params) { - return new File(getConfigRoot(params), - APP_NAME.fetchFrom(params) + ".properties"); - } - - File getConfigRoot(Map params) { - return CONFIG_ROOT.fetchFrom(params); - } - @Override public Path getAppDir() { return appDir; @@ -200,41 +162,6 @@ public void prepareApplicationFiles(Map params) public void prepareJreFiles(Map params) throws IOException {} - private void validateValueAndPut( - Map data, String key, - BundlerParamInfo param, - Map params) { - String value = param.fetchFrom(params); - if (value.contains("\r") || value.contains("\n")) { - Log.error("Configuration Parameter " + param.getID() - + " contains multiple lines of text, ignore it"); - data.put(key, ""); - return; - } - data.put(key, value); - } - - protected void prepareExecutableProperties( - Map params) throws IOException { - - Map data = new HashMap<>(); - - // mapping Java parameters in strings for version resource - validateValueAndPut(data, "COMPANY_NAME", VENDOR, params); - validateValueAndPut(data, "FILE_DESCRIPTION", DESCRIPTION, params); - validateValueAndPut(data, "FILE_VERSION", VERSION, params); - data.put("INTERNAL_NAME", getLauncherName(params)); - validateValueAndPut(data, "LEGAL_COPYRIGHT", COPYRIGHT, params); - data.put("ORIGINAL_FILENAME", getLauncherName(params)); - validateValueAndPut(data, "PRODUCT_NAME", APP_NAME, params); - validateValueAndPut(data, "PRODUCT_VERSION", VERSION, params); - - createResource(EXECUTABLE_PROPERTIES_TEMPLATE, params) - .setCategory(I18N.getString("resource.executable-properties-template")) - .setSubstitutionData(data) - .saveToFile(getConfig_ExecutableProperties(params)); - } - private void createLauncherForEntryPoint(Map params, Map mainParams) throws IOException { @@ -251,8 +178,6 @@ private void createLauncherForEntryPoint(Map params, writeCfgFile(params, root.resolve( getLauncherCfgName(params)).toFile()); - prepareExecutableProperties(params); - // Copy executable to bin folder Path executableFile = binDir.resolve(getLauncherName(params)); @@ -261,47 +186,11 @@ private void createLauncherForEntryPoint(Map params, writeEntry(is_launcher, executableFile); } - File launcher = executableFile.toFile(); - launcher.setWritable(true, true); + // Update branding of launcher executable + new ExecutableRebrander().rebrandLauncher(params, iconTarget, executableFile); - // Update branding of EXE file - if (REBRAND_EXECUTABLE.fetchFrom(params)) { - try { - String tempDirectory = WindowsDefender.getUserTempDirectory(); - if (Arguments.CLIOptions.context().userProvidedBuildRoot) { - tempDirectory = - TEMP_ROOT.fetchFrom(params).getAbsolutePath(); - } - if (WindowsDefender.isThereAPotentialWindowsDefenderIssue( - tempDirectory)) { - Log.verbose(MessageFormat.format(I18N.getString( - "message.potential.windows.defender.issue"), - tempDirectory)); - } - - launcher.setWritable(true); - - if (iconTarget != null) { - iconSwap(iconTarget.toAbsolutePath().toString(), - launcher.getAbsolutePath()); - } - - File executableProperties = - getConfig_ExecutableProperties(params); - - if (executableProperties.exists()) { - if (versionSwap(executableProperties.getAbsolutePath(), - launcher.getAbsolutePath()) != 0) { - throw new RuntimeException(MessageFormat.format( - I18N.getString("error.version-swap"), - executableProperties.getAbsolutePath())); - } - } - } finally { - executableFile.toFile().setExecutable(true); - executableFile.toFile().setReadOnly(); - } - } + executableFile.toFile().setExecutable(true); + executableFile.toFile().setReadOnly(); } private void copyApplication(Map params) @@ -321,10 +210,4 @@ private void copyApplication(Map params) } } } - - private static native int iconSwap(String iconTarget, String launcher); - - private static native int versionSwap(String executableProperties, - String launcher); - } diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinInstaller.template b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinInstaller.template new file mode 100644 index 00000000000..57ac0401660 --- /dev/null +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinInstaller.template @@ -0,0 +1,10 @@ +FIXEDFILEINFO_FileVersion=FIXEDFILEINFO_FILE_VERSION +FIXEDFILEINFO_ProductVersion=FIXEDFILEINFO_FILE_VERSION +CompanyName=COMPANY_NAME +FileDescription=Installer of FILE_DESCRIPTION +FileVersion=FILE_VERSION +InternalName=INTERNAL_NAME +LegalCopyright=LEGAL_COPYRIGHT +OriginalFilename=ORIGINAL_FILENAME +ProductName=PRODUCT_NAME Installer +ProductVersion=FILE_VERSION diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template index d17a31662d0..2c5d227a000 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template @@ -1,3 +1,5 @@ +FIXEDFILEINFO_FileVersion=FIXEDFILEINFO_FILE_VERSION +FIXEDFILEINFO_ProductVersion=FIXEDFILEINFO_FILE_VERSION CompanyName=COMPANY_NAME FileDescription=FILE_DESCRIPTION FileVersion=FILE_VERSION @@ -5,4 +7,4 @@ InternalName=INTERNAL_NAME LegalCopyright=LEGAL_COPYRIGHT OriginalFilename=ORIGINAL_FILENAME ProductName=PRODUCT_NAME -ProductVersion=PRODUCT_VERSION +ProductVersion=FILE_VERSION diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/ByteBuffer.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/ByteBuffer.cpp deleted file mode 100644 index b6dc39dd2b2..00000000000 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/ByteBuffer.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include "ByteBuffer.h" - -#include - -ByteBuffer::ByteBuffer() { - buffer.reserve(1024); -} - -ByteBuffer::~ByteBuffer() { -} - -LPBYTE ByteBuffer::getPtr() { - return &buffer[0]; -} - -size_t ByteBuffer::getPos() { - return buffer.size(); -} - -void ByteBuffer::AppendString(wstring str) { - size_t len = (str.size() + 1) * sizeof (WCHAR); - AppendBytes((BYTE*) str.c_str(), len); -} - -void ByteBuffer::AppendWORD(WORD word) { - AppendBytes((BYTE*) & word, sizeof (WORD)); -} - -void ByteBuffer::Align(size_t bytesNumber) { - size_t pos = getPos(); - if (pos % bytesNumber) { - DWORD dwNull = 0; - size_t len = bytesNumber - pos % bytesNumber; - AppendBytes((BYTE*) & dwNull, len); - } -} - -void ByteBuffer::AppendBytes(BYTE* ptr, size_t len) { - buffer.insert(buffer.end(), ptr, ptr + len); -} - -void ByteBuffer::ReplaceWORD(size_t offset, WORD word) { - ReplaceBytes(offset, (BYTE*) & word, sizeof (WORD)); -} - -void ByteBuffer::ReplaceBytes(size_t offset, BYTE* ptr, size_t len) { - for (size_t i = 0; i < len; i++) { - buffer[offset + i] = *(ptr + i); - } -} diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.cpp index a09ba7ef94f..b7d604fc659 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.cpp +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,7 @@ void PrintError() { // Note: We do not check here that iconTarget is valid icon. // Java code will already do this for us. -bool ChangeIcon(wstring iconTarget, wstring launcher) { +bool ChangeIcon(HANDLE update, const wstring& iconTarget) { WORD language = MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT); HANDLE icon = CreateFile(iconTarget.c_str(), GENERIC_READ, 0, NULL, @@ -154,15 +154,6 @@ bool ChangeIcon(wstring iconTarget, wstring launcher) { } // Store images in .EXE - HANDLE update = BeginUpdateResource(launcher.c_str(), FALSE); - if (update == NULL) { - free(lpid); - free(lpgid); - CloseHandle(icon); - PrintError(); - return false; - } - for (int i = 0; i < lpid->idCount; i++) { LPBYTE lpBuffer = (LPBYTE) malloc(lpid->idEntries[i].dwBytesInRes); SetFilePointer(icon, lpid->idEntries[i].dwImageOffset, @@ -195,10 +186,5 @@ bool ChangeIcon(wstring iconTarget, wstring launcher) { free(lpgid); - if (EndUpdateResource(update, FALSE) == FALSE) { - PrintError(); - return false; - } - return true; } diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.h b/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.h index 75390273bb1..d653e0e2070 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.h +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,9 +28,7 @@ #include -using namespace std; - -bool ChangeIcon(wstring iconTarget, wstring launcher); +bool ChangeIcon(HANDLE update, const std::wstring& iconTarget); #endif // ICONSWAP_H diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.cpp new file mode 100644 index 00000000000..0549417f47d --- /dev/null +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include "JniUtils.h" +#include "ErrorHandling.h" +#include "Toolbox.h" + + +namespace jni { + +void JniObjWithEnv::LocalRefDeleter::operator()(pointer v) { + if (v.env && v.obj) { + v.env->DeleteLocalRef(v.obj); + } +} + + +#ifdef TSTRINGS_WITH_WCHAR +std::wstring toUnicodeString(JNIEnv *env, jstring val) { + const jchar* chars = env->GetStringChars(val, 0); + if (!chars) { + JP_THROW("GetStringChars() failed"); + } + + const auto releaseStringChars = + runAtEndOfScope([env, val, chars]() -> void { + env->ReleaseStringChars(val, chars); + }); + + const jsize len = env->GetStringLength(val); + + return std::wstring(reinterpret_cast(chars), len); +} + + +jstring toJString(JNIEnv *env, const std::wstring& val) { + jstring result = env->NewString( + reinterpret_cast(val.c_str()), jsize(val.size())); + if (!result) { + JP_THROW("NewString() failed"); + } + return result; +} +#endif + + +tstring_array toUnicodeStringArray(JNIEnv *env, jobjectArray val) { + tstring_array result; + + const jsize len = env->GetArrayLength(val); + for (int i = 0; i < len; ++i) { + LocalRef localRef(JniObjWithEnv(env, + env->GetObjectArrayElement(val, i))); + result.push_back(toUnicodeString(env, + static_cast(localRef.get().obj))); + } + + return result; +} + +} // namespace jni diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfoSwap.h b/src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.h similarity index 54% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfoSwap.h rename to src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.h index 27ad633a542..8f5f38293da 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfoSwap.h +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,31 +23,49 @@ * questions. */ -#ifndef VERSIONINFOSWAP_H -#define VERSIONINFOSWAP_H +#ifndef JNIUTILS_H +#define JNIUTILS_H -#include "ByteBuffer.h" -#include +#include "jni.h" +#include "tstrings.h" -using namespace std; -class VersionInfoSwap { -public: - VersionInfoSwap(wstring executableProperties, wstring launcher); +namespace jni { - bool PatchExecutable(); +struct JniObjWithEnv { + JniObjWithEnv(): env(0), obj(0) { -private: - wstring m_executableProperties; - wstring m_launcher; + } - map m_props; + JniObjWithEnv(JNIEnv *env, jobject obj) : env(env), obj(obj) { + } - bool LoadFromPropertyFile(); - bool CreateNewResource(ByteBuffer *buf); - bool UpdateResource(LPVOID lpResLock, DWORD size); - bool FillFixedFileInfo(VS_FIXEDFILEINFO *fxi); + bool operator == (const JniObjWithEnv& other) const { + return env == other.env && obj == other.obj; + } + + bool operator != (const JniObjWithEnv& other) const { + return ! operator == (other); + } + + JNIEnv *env; + jobject obj; + + struct LocalRefDeleter { + typedef JniObjWithEnv pointer; + + void operator()(pointer v); + }; }; -#endif // VERSIONINFOSWAP_H +typedef std::unique_ptr LocalRef; + +tstring toUnicodeString(JNIEnv *env, jstring val); + +jstring toJString(JNIEnv *env, const tstring& val); + +tstring_array toUnicodeStringArray(JNIEnv *env, jobjectArray val); + +} // namespace jni +#endif // JNIUTILS_H diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.cpp index 95766b87570..288a1d2394c 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.cpp +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,12 +37,19 @@ ResourceEditor::FileLock::FileLock(const std::wstring& binaryPath) { << binaryPath << ") failed", BeginUpdateResource)); } + ownHandle(true); + discard(false); +} + + +ResourceEditor::FileLock::FileLock(HANDLE h): h(h) { + ownHandle(false); discard(false); } ResourceEditor::FileLock::~FileLock() { - if (!EndUpdateResource(h, theDiscard)) { + if (theOwnHandle && !EndUpdateResource(h, theDiscard)) { JP_NO_THROW(JP_THROW(SysError(tstrings::any() << "EndUpdateResource(" << h << ") failed.", EndUpdateResource))); } @@ -85,8 +92,8 @@ ResourceEditor& ResourceEditor::id(LPCWSTR v) { theId = printer.str(); } else { theId = v; - theIdPtr = theId.c_str(); } + theIdPtr = v; return *this; } diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.h b/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.h index 388de30deec..8e7664cd47e 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.h +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,8 @@ class ResourceEditor { public: class FileLock { public: - FileLock(const std::wstring& binaryPath); + explicit FileLock(const std::wstring& binaryPath); + explicit FileLock(HANDLE h); ~FileLock(); HANDLE get() const { @@ -46,11 +47,17 @@ class ResourceEditor { theDiscard = v; } + FileLock& ownHandle(bool v) { + theOwnHandle = v; + return *this; + } + private: FileLock(const FileLock&); FileLock& operator=(const FileLock&); private: HANDLE h; + bool theOwnHandle; bool theDiscard; }; diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/Utils.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/Utils.cpp deleted file mode 100644 index 043265f3c7a..00000000000 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/Utils.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include "Windows.h" -#include "Utils.h" - -#define BUFFER_SIZE 4096 - -wstring GetStringFromJString(JNIEnv *pEnv, jstring jstr) { - const jchar *pJChars = pEnv->GetStringChars(jstr, NULL); - if (pJChars == NULL) { - return wstring(L""); - } - - wstring wstr(pJChars); - - pEnv->ReleaseStringChars(jstr, pJChars); - - return wstr; -} - -jstring GetJStringFromString(JNIEnv *pEnv, - const jchar *unicodeChars, jsize len) { - return pEnv->NewString(unicodeChars, len); -} - -wstring GetLongPath(wstring path) { - wstring result(L""); - - size_t len = path.length(); - if (len > 1) { - if (path.at(len - 1) == '\\') { - path.erase(len - 1); - } - } - - TCHAR *pBuffer = new TCHAR[BUFFER_SIZE]; - if (pBuffer != NULL) { - DWORD dwResult = GetLongPathName(path.c_str(), pBuffer, BUFFER_SIZE); - if (dwResult > 0 && dwResult < BUFFER_SIZE) { - result = wstring(pBuffer); - } else { - delete [] pBuffer; - pBuffer = new TCHAR[dwResult]; - if (pBuffer != NULL) { - DWORD dwResult2 = - GetLongPathName(path.c_str(), pBuffer, dwResult); - if (dwResult2 == (dwResult - 1)) { - result = wstring(pBuffer); - } - } - } - - if (pBuffer != NULL) { - delete [] pBuffer; - } - } - - return result; -} diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.cpp new file mode 100644 index 00000000000..52e885208bc --- /dev/null +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.cpp @@ -0,0 +1,279 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include +#include +#include "VersionInfo.h" +#include "ResourceEditor.h" +#include "ErrorHandling.h" +#include "Toolbox.h" + + +VersionInfo::VersionInfo() { + +} + +namespace { + +class FixedFileVersion { +public: + FixedFileVersion(const std::wstring& value) { + if (4 != swscanf_s(value.c_str(), L"%d.%d.%d.%d", components + 0, + components + 1, components + 2, components + 3)) { + JP_THROW(tstrings::any() + << "Malformed file version value: [" + << value + << "]"); + forEach(components, [&value](int component) -> void { + if (USHRT_MAX < component) { + JP_THROW(tstrings::any() + << "Invalid file version value: [" + << value + << "]"); + } + }); + } + } + + void apply(DWORD& ms, DWORD& ls) const { + ms = MAKELONG(components[1], components[0]); + ls = MAKELONG(components[3], components[2]); + } + +private: + int components[4]; +}; + + +std::ostream& writeWORD(std::ostream& cout, size_t v) { + if (USHRT_MAX < v) { + JP_THROW("Invalid WORD value"); + } + return cout.write(reinterpret_cast(&v), sizeof(WORD)); +} + + +std::ostream& writeDWORD(std::ostream& cout, size_t v) { + if (UINT_MAX < v) { + JP_THROW("Invalid DWORD value"); + } + + return cout.write(reinterpret_cast(&v), sizeof(DWORD)); +} + + +std::ostream& write(std::ostream& cout, const VS_FIXEDFILEINFO& v) { + return cout.write(reinterpret_cast(&v), sizeof(v)); +} + +std::ostream& write(std::ostream& cout, const std::wstring& s) { + return cout.write(reinterpret_cast(s.c_str()), + (s.size() + 1 /* trailing 0 */) * sizeof(wchar_t)); +} + +void add32bitPadding(std::ostream& cout) { + enum { WordAlign = 2 }; + const std::streampos pos = cout.tellp(); + if (pos % 2) { + JP_THROW("Invalid data written in the stream"); + } + const int padding = WordAlign - (pos / 2) % WordAlign; + if (WordAlign != padding) { + for (int i = 0; i < padding; ++i) { + writeWORD(cout, 0); + } + } +} + + +class StreamSize { +public: + StreamSize(std::ostream& out): stream(out), anchor(out.tellp()) { + writeWORD(stream, 0); // placeholder + } + + ~StreamSize() { + JP_TRY; + + const std::streampos curPos = stream.tellp(); + const std::streampos size = curPos - anchor; + stream.seekp(anchor); + if (size < 0) { + JP_THROW("Invalid negative size value"); + } + writeWORD(stream, (size_t) size); + stream.seekp(curPos); + + JP_CATCH_ALL; + } + +private: + std::ostream& stream; + std::streampos anchor; +}; + +} // namespace + +VersionInfo& VersionInfo::setProperty( + const std::wstring& id, const std::wstring& value) { + props[id] = value; + + if (id == L"FIXEDFILEINFO_FileVersion") { + // Validate input + const ::FixedFileVersion validate(value); + } + return *this; +} + + +const VersionInfo& VersionInfo::apply( + const ResourceEditor::FileLock& fileLock) const { + if (props.find(L"FIXEDFILEINFO_FileVersion") == props.end()) { + JP_THROW("Missing mandatory FILEVERSION property"); + } + + std::stringstream buf( + std::stringstream::in | std::stringstream::out | std::stringstream::binary); + buf.exceptions(std::ios::failbit | std::ios::badbit); + + fillBuffer(buf); + + buf.seekg(0); + + ResourceEditor() + .id(MAKEINTRESOURCE(VS_VERSION_INFO)) + .type(RT_VERSION) + .apply(fileLock, buf); + return *this; +} + + +void VersionInfo::fillBuffer(std::ostream& buf) const { + // Fill VS_VERSIONINFO pseudo structure + StreamSize versionInfoLength(buf); // wLength + writeWORD(buf, sizeof(VS_FIXEDFILEINFO)); // wValueLength + writeWORD(buf, 0); // wType + write(buf, L"VS_VERSION_INFO"); // szKey + add32bitPadding(buf); // Padding1 + write(buf, createFIXEDFILEINFO()); // Value + add32bitPadding(buf); // Padding2 + + const DWORD neutralLangId = (0x04b0 | MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) << 16); + const DWORD engLangId = (0x04b0 | MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US) << 16); + + do { + // Fill StringFileInfo pseudo structure + StreamSize stringFileInfoLength(buf); // wLength + writeWORD(buf, 0); // wValueLength + writeWORD(buf, 1); // wType + write(buf, L"StringFileInfo"); // szKey + add32bitPadding(buf); // Padding + + // Fill StringTable pseudo structure + StreamSize stringTableLength(buf); // wLength + writeWORD(buf, 0); // wValueLength + writeWORD(buf, 1); // wType + + const std::wstring strLangId = (std::wstringstream() + << std::uppercase + << std::hex + << std::setw(8) + << std::setfill(L'0') + << engLangId).str(); + write(buf, strLangId); // szKey + add32bitPadding(buf); // Padding + + forEach(props, [&buf](const PropertyMap::value_type& entry) -> void { + if (entry.first.rfind(L"FIXEDFILEINFO_", 0) == 0) { + // Ignore properties to be used to initialize data in + // VS_FIXEDFILEINFO structure. + return; + } + + // Fill String pseudo structure + StreamSize stringLength(buf); // wLength + writeWORD(buf, entry.second.size()); // wValueLength + writeWORD(buf, 1); // wType + write(buf, entry.first); // wKey + add32bitPadding(buf); // Padding1 + write(buf, entry.second); // Value + add32bitPadding(buf); // Padding2 + }); + } while (0); + + // Fill VarFileInfo pseudo structure + StreamSize varFileInfoLength(buf); // wLength + writeWORD(buf, 0); // wValueLength + writeWORD(buf, 1); // wType + write(buf, L"VarFileInfo"); // szKey + add32bitPadding(buf); // Padding + + // Fill Var pseudo structure + StreamSize varLength(buf); // wLength + writeWORD(buf, sizeof(DWORD)); // wValueLength + writeWORD(buf, 0); // wType + write(buf, L"Translation"); // szKey + add32bitPadding(buf); // Padding + writeDWORD(buf, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)); // Value +} + + +VS_FIXEDFILEINFO VersionInfo::createFIXEDFILEINFO() const { + const ::FixedFileVersion fileVersion(props.find( + L"FIXEDFILEINFO_FileVersion")->second); + + VS_FIXEDFILEINFO result; + ZeroMemory(&result, sizeof(result)); + + result.dwSignature = 0xFEEF04BD; + result.dwStrucVersion = 0x00010000; + result.dwFileOS = VOS_NT_WINDOWS32; + result.dwFileType = VFT_APP; + + fileVersion.apply(result.dwFileVersionMS, result.dwFileVersionLS); + + PropertyMap::const_iterator entry = props.find( + L"FIXEDFILEINFO_ProductVersion"); + if (entry == props.end()) { + fileVersion.apply(result.dwProductVersionMS, result.dwProductVersionLS); + } else { + bool fatalError = false; + try { + const ::FixedFileVersion productVersion(entry->second); + fatalError = true; + productVersion.apply(result.dwProductVersionMS, + result.dwProductVersionLS); + } catch (const std::exception&) { + if (fatalError) { + throw; + } + // Failed to parse product version as four component version string. + fileVersion.apply(result.dwProductVersionMS, + result.dwProductVersionLS); + } + } + + return result; +} diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/ByteBuffer.h b/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.h similarity index 56% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/ByteBuffer.h rename to src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.h index 343b993675b..af2df95a92e 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/ByteBuffer.h +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,35 +23,40 @@ * questions. */ -#ifndef BYTEBUFFER_H -#define BYTEBUFFER_H +#ifndef VERSIONINFO_H +#define VERSIONINFO_H -#include -#include +#include #include +#include "ResourceEditor.h" -using namespace std; -class ByteBuffer { +class VersionInfo { public: - ByteBuffer(); - ~ByteBuffer(); + VersionInfo(); - LPBYTE getPtr(); - size_t getPos(); + VersionInfo& setProperty(const std::wstring& id, const std::wstring& value); - void AppendString(wstring str); - void AppendWORD(WORD word); - void AppendBytes(BYTE* ptr, size_t len); + /** + * Replaces existing VS_VERSIONINFO structure in the file locked + * with the passed in ResourceEditor::FileLock instance with data + * configured for this instance. + */ + const VersionInfo& apply(const ResourceEditor::FileLock& fileLock) const; - void ReplaceWORD(size_t offset, WORD word); - void ReplaceBytes(size_t offset, BYTE* ptr, size_t len); - - void Align(size_t bytesNumber); + VersionInfo& apply(const ResourceEditor::FileLock& fileLock) { + static_cast(*this).apply(fileLock); + return *this; + } private: - vector buffer; -}; + void fillBuffer(std::ostream& buf) const; + + VS_FIXEDFILEINFO createFIXEDFILEINFO() const; -#endif // BYTEBUFFER_H + typedef std::map PropertyMap; + + PropertyMap props; +}; +#endif // #ifndef VERSIONINFO_H diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfoSwap.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfoSwap.cpp deleted file mode 100644 index f48066673b2..00000000000 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfoSwap.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include "VersionInfoSwap.h" - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace std; - -/* - * [Property file] contains key/value pairs - * The swap tool uses these pairs to create new version resource - * - * See MSDN docs for VS_VERSIONINFO structure that - * depicts organization of data in this version resource - * https://msdn.microsoft.com/en-us/library/ms647001(v=vs.85).aspx - * - * The swap tool makes changes in [Executable file] - * The tool assumes that the executable file has no version resource - * and it adds new resource in the executable file. - * If the executable file has an existing version resource, then - * the existing version resource will be replaced with new one. - */ - -VersionInfoSwap::VersionInfoSwap(wstring executableProperties, - wstring launcher) { - m_executableProperties = executableProperties; - m_launcher = launcher; -} - -bool VersionInfoSwap::PatchExecutable() { - bool b = LoadFromPropertyFile(); - if (!b) { - return false; - } - - ByteBuffer buf; - b = CreateNewResource(&buf); - if (!b) { - return false; - } - - b = this->UpdateResource(buf.getPtr(), static_cast (buf.getPos())); - if (!b) { - return false; - } - - return true; -} - -bool VersionInfoSwap::LoadFromPropertyFile() { - wifstream stream(m_executableProperties.c_str()); - - const locale empty_locale = locale::empty(); - const locale utf8_locale = - locale(empty_locale, new codecvt_utf8()); - stream.imbue(utf8_locale); - - if (stream.is_open() == true) { - int lineNumber = 1; - while (stream.eof() == false) { - wstring line; - getline(stream, line); - - // # at the first character will comment out the line. - if (line.empty() == false && line[0] != '#') { - wstring::size_type pos = line.find('='); - if (pos != wstring::npos) { - wstring name = line.substr(0, pos); - wstring value = line.substr(pos + 1); - m_props[name] = value; - } - } - lineNumber++; - } - return true; - } - - return false; -} - -/* - * Creates new version resource - * - * MSND docs for VS_VERSION_INFO structure - * https://msdn.microsoft.com/en-us/library/ms647001(v=vs.85).aspx - */ -bool VersionInfoSwap::CreateNewResource(ByteBuffer *buf) { - size_t versionInfoStart = buf->getPos(); - buf->AppendWORD(0); - buf->AppendWORD(sizeof VS_FIXEDFILEINFO); - buf->AppendWORD(0); - buf->AppendString(TEXT("VS_VERSION_INFO")); - buf->Align(4); - - VS_FIXEDFILEINFO fxi; - if (!FillFixedFileInfo(&fxi)) { - return false; - } - buf->AppendBytes((BYTE*) & fxi, sizeof (VS_FIXEDFILEINFO)); - buf->Align(4); - - // String File Info - size_t stringFileInfoStart = buf->getPos(); - buf->AppendWORD(0); - buf->AppendWORD(0); - buf->AppendWORD(1); - buf->AppendString(TEXT("StringFileInfo")); - buf->Align(4); - - // String Table - size_t stringTableStart = buf->getPos(); - buf->AppendWORD(0); - buf->AppendWORD(0); - buf->AppendWORD(1); - - // "040904B0" = LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP - buf->AppendString(TEXT("040904B0")); - buf->Align(4); - - // Strings - vector keys; - for (map::const_iterator it = - m_props.begin(); it != m_props.end(); ++it) { - keys.push_back(it->first); - } - - for (size_t index = 0; index < keys.size(); index++) { - wstring name = keys[index]; - wstring value = m_props[name]; - - size_t stringStart = buf->getPos(); - buf->AppendWORD(0); - buf->AppendWORD(static_cast (value.length())); - buf->AppendWORD(1); - buf->AppendString(name); - buf->Align(4); - buf->AppendString(value); - buf->ReplaceWORD(stringStart, - static_cast (buf->getPos() - stringStart)); - buf->Align(4); - } - - buf->ReplaceWORD(stringTableStart, - static_cast (buf->getPos() - stringTableStart)); - buf->ReplaceWORD(stringFileInfoStart, - static_cast (buf->getPos() - stringFileInfoStart)); - - // VarFileInfo - size_t varFileInfoStart = buf->getPos(); - buf->AppendWORD(1); - buf->AppendWORD(0); - buf->AppendWORD(1); - buf->AppendString(TEXT("VarFileInfo")); - buf->Align(4); - - buf->AppendWORD(0x24); - buf->AppendWORD(0x04); - buf->AppendWORD(0x00); - buf->AppendString(TEXT("Translation")); - buf->Align(4); - // "000004B0" = LANG_NEUTRAL/SUBLANG_ENGLISH_US, Unicode CP - buf->AppendWORD(0x0000); - buf->AppendWORD(0x04B0); - - buf->ReplaceWORD(varFileInfoStart, - static_cast (buf->getPos() - varFileInfoStart)); - buf->ReplaceWORD(versionInfoStart, - static_cast (buf->getPos() - versionInfoStart)); - - return true; -} - -bool VersionInfoSwap::FillFixedFileInfo(VS_FIXEDFILEINFO *fxi) { - wstring fileVersion; - wstring productVersion; - int ret; - - fileVersion = m_props[TEXT("FileVersion")]; - productVersion = m_props[TEXT("ProductVersion")]; - - unsigned fv_1 = 0, fv_2 = 0, fv_3 = 0, fv_4 = 0; - unsigned pv_1 = 0, pv_2 = 0, pv_3 = 0, pv_4 = 0; - - ret = _stscanf_s(fileVersion.c_str(), - TEXT("%d.%d.%d.%d"), &fv_1, &fv_2, &fv_3, &fv_4); - if (ret <= 0 || ret > 4) { - return false; - } - - ret = _stscanf_s(productVersion.c_str(), - TEXT("%d.%d.%d.%d"), &pv_1, &pv_2, &pv_3, &pv_4); - if (ret <= 0 || ret > 4) { - return false; - } - - fxi->dwSignature = 0xFEEF04BD; - fxi->dwStrucVersion = 0x00010000; - - fxi->dwFileVersionMS = MAKELONG(fv_2, fv_1); - fxi->dwFileVersionLS = MAKELONG(fv_4, fv_3); - fxi->dwProductVersionMS = MAKELONG(pv_2, pv_1); - fxi->dwProductVersionLS = MAKELONG(pv_4, pv_3); - - fxi->dwFileFlagsMask = 0; - fxi->dwFileFlags = 0; - fxi->dwFileOS = VOS_NT_WINDOWS32; - - wstring exeExt = - m_launcher.substr(m_launcher.find_last_of(TEXT("."))); - if (exeExt == TEXT(".exe")) { - fxi->dwFileType = VFT_APP; - } else if (exeExt == TEXT(".dll")) { - fxi->dwFileType = VFT_DLL; - } else { - fxi->dwFileType = VFT_UNKNOWN; - } - fxi->dwFileSubtype = 0; - - fxi->dwFileDateLS = 0; - fxi->dwFileDateMS = 0; - - return true; -} - -/* - * Adds new resource in the executable - */ -bool VersionInfoSwap::UpdateResource(LPVOID lpResLock, DWORD size) { - - HANDLE hUpdateRes; - BOOL r; - - hUpdateRes = ::BeginUpdateResource(m_launcher.c_str(), FALSE); - if (hUpdateRes == NULL) { - return false; - } - - r = ::UpdateResource(hUpdateRes, - RT_VERSION, - MAKEINTRESOURCE(VS_VERSION_INFO), - MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), - lpResLock, - size); - - if (!r) { - return false; - } - - if (!::EndUpdateResource(hUpdateRes, FALSE)) { - return false; - } - - return true; -} diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp index 52af7e548f3..80ba6ce0964 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp @@ -23,17 +23,50 @@ * questions. */ -#include -#include -#include -#include - -#include "Utils.h" +#include "JniUtils.h" +#include "FileUtils.h" +#include "ErrorHandling.h" #pragma comment(lib, "advapi32") -// Max value name size per MSDN plus NULL -#define VALUE_NAME_SIZE 16384 +namespace { + +std::wstring GetLongPath(const std::wstring& path) { + const std::wstring cleanPath = FileUtils::removeTrailingSlash(path); + if (cleanPath.size() != path.size()) { + return GetLongPath(cleanPath); + } + + enum { BUFFER_SIZE = 4096 }; + + std::wstring result; + + TCHAR *pBuffer = new TCHAR[BUFFER_SIZE]; + if (pBuffer != NULL) { + DWORD dwResult = GetLongPathName(path.c_str(), pBuffer, BUFFER_SIZE); + if (dwResult > 0 && dwResult < BUFFER_SIZE) { + result = std::wstring(pBuffer); + } else { + delete [] pBuffer; + pBuffer = new TCHAR[dwResult]; + if (pBuffer != NULL) { + DWORD dwResult2 = + GetLongPathName(path.c_str(), pBuffer, dwResult); + if (dwResult2 == (dwResult - 1)) { + result = std::wstring(pBuffer); + } + } + } + + if (pBuffer != NULL) { + delete [] pBuffer; + } + } + + return result; +} + +} // namespace #ifdef __cplusplus extern "C" { @@ -52,12 +85,14 @@ extern "C" { jstring jValue, jint defaultValue) { jint jResult = defaultValue; + JP_TRY; + if (key != jdk_incubator_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE) { - return jResult; + JP_THROW("Inavlid Windows registry key id"); } - wstring subKey = GetStringFromJString(pEnv, jSubKey); - wstring value = GetStringFromJString(pEnv, jValue); + const std::wstring subKey = jni::toUnicodeString(pEnv, jSubKey); + const std::wstring value = jni::toUnicodeString(pEnv, jValue); HKEY hSubKey = NULL; LSTATUS status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, subKey.c_str(), 0, @@ -74,6 +109,8 @@ extern "C" { RegCloseKey(hSubKey); } + JP_CATCH_ALL; + return jResult; } @@ -85,11 +122,14 @@ extern "C" { JNIEXPORT jlong JNICALL Java_jdk_incubator_jpackage_internal_WindowsRegistry_openRegistryKey( JNIEnv *pEnv, jclass c, jint key, jstring jSubKey) { + + JP_TRY; + if (key != jdk_incubator_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE) { - return 0; + JP_THROW("Inavlid Windows registry key id"); } - wstring subKey = GetStringFromJString(pEnv, jSubKey); + const std::wstring subKey = jni::toUnicodeString(pEnv, jSubKey); HKEY hSubKey = NULL; LSTATUS status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, subKey.c_str(), 0, KEY_QUERY_VALUE, &hSubKey); @@ -97,6 +137,8 @@ extern "C" { return (jlong)hSubKey; } + JP_CATCH_ALL; + return 0; } @@ -108,6 +150,12 @@ extern "C" { JNIEXPORT jstring JNICALL Java_jdk_incubator_jpackage_internal_WindowsRegistry_enumRegistryValue( JNIEnv *pEnv, jclass c, jlong lKey, jint jIndex) { + + JP_TRY; + + // Max value name size per MSDN plus NULL + enum { VALUE_NAME_SIZE = 16384 }; + HKEY hKey = (HKEY)lKey; TCHAR valueName[VALUE_NAME_SIZE] = {0}; // Max size per MSDN plus NULL DWORD cchValueName = VALUE_NAME_SIZE; @@ -117,10 +165,12 @@ extern "C" { size_t chLength = 0; if (StringCchLength(valueName, VALUE_NAME_SIZE, &chLength) == S_OK) { - return GetJStringFromString(pEnv, valueName, (jsize)chLength); + return jni::toJString(pEnv, std::wstring(valueName, chLength)); } } + JP_CATCH_ALL; + return NULL; } @@ -144,24 +194,25 @@ extern "C" { JNIEXPORT jboolean JNICALL Java_jdk_incubator_jpackage_internal_WindowsRegistry_comparePaths( JNIEnv *pEnv, jclass c, jstring jPath1, jstring jPath2) { - wstring path1 = GetStringFromJString(pEnv, jPath1); - wstring path2 = GetStringFromJString(pEnv, jPath2); + + JP_TRY; + + std::wstring path1 = jni::toUnicodeString(pEnv, jPath1); + std::wstring path2 = jni::toUnicodeString(pEnv, jPath2); path1 = GetLongPath(path1); path2 = GetLongPath(path2); - if (path1.length() == 0 || path2.length() == 0) { - return JNI_FALSE; - } - - if (path1.length() != path2.length()) { + if (path1.empty() || path2.empty()) { return JNI_FALSE; } - if (_tcsnicmp(path1.c_str(), path2.c_str(), path1.length()) == 0) { + if (tstrings::equals(path1, path2, tstrings::IGNORE_CASE)) { return JNI_TRUE; } + JP_CATCH_ALL; + return JNI_FALSE; } diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/jpackage.cpp b/src/jdk.incubator.jpackage/windows/native/libjpackage/jpackage.cpp index 048c7aff9cb..4e1a574d963 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/jpackage.cpp +++ b/src/jdk.incubator.jpackage/windows/native/libjpackage/jpackage.cpp @@ -23,80 +23,125 @@ * questions. */ -#include -#include -#include -#include - #include "ResourceEditor.h" -#include "WinErrorHandling.h" +#include "ErrorHandling.h" #include "IconSwap.h" -#include "VersionInfoSwap.h" -#include "Utils.h" - -using namespace std; +#include "VersionInfo.h" +#include "JniUtils.h" #ifdef __cplusplus extern "C" { #endif /* - * Class: jdk_incubator_jpackage_internal_WindowsAppImageBuilder + * Class: jdk_incubator_jpackage_internal_ExecutableRebrander + * Method: lockResource + * Signature: (Ljava/lang/String;)J + */ + JNIEXPORT jlong JNICALL + Java_jdk_incubator_jpackage_internal_ExecutableRebrander_lockResource( + JNIEnv *pEnv, jclass c, jstring jExecutable) { + + JP_TRY; + + const std::wstring executable = jni::toUnicodeString(pEnv, jExecutable); + + return reinterpret_cast( + ResourceEditor::FileLock(executable).ownHandle(false).get()); + + JP_CATCH_ALL; + + return 0; + } + + /* + * Class: jdk_incubator_jpackage_internal_ExecutableRebrander + * Method: unlockResource + * Signature: (J;)V + */ + JNIEXPORT void JNICALL + Java_jdk_incubator_jpackage_internal_ExecutableRebrander_unlockResource( + JNIEnv *pEnv, jclass c, jlong jResourceLock) { + + JP_TRY; + ResourceEditor::FileLock( + reinterpret_cast(jResourceLock)).ownHandle(true); + JP_CATCH_ALL; + } + + /* + * Class: jdk_incubator_jpackage_internal_ExecutableRebrander * Method: iconSwap - * Signature: (Ljava/lang/String;Ljava/lang/String;)I + * Signature: (J;Ljava/lang/String;)I */ JNIEXPORT jint JNICALL - Java_jdk_incubator_jpackage_internal_WindowsAppImageBuilder_iconSwap( - JNIEnv *pEnv, jclass c, jstring jIconTarget, jstring jLauncher) { - wstring iconTarget = GetStringFromJString(pEnv, jIconTarget); - wstring launcher = GetStringFromJString(pEnv, jLauncher); + Java_jdk_incubator_jpackage_internal_ExecutableRebrander_iconSwap( + JNIEnv *pEnv, jclass c, jlong jResourceLock, jstring jIconTarget) { + + JP_TRY; + + const ResourceEditor::FileLock lock(reinterpret_cast(jResourceLock)); - if (ChangeIcon(iconTarget, launcher)) { + const std::wstring iconTarget = jni::toUnicodeString(pEnv, jIconTarget); + + if (ChangeIcon(lock.get(), iconTarget)) { return 0; } + JP_CATCH_ALL; + return 1; } /* - * Class: jdk_incubator_jpackage_internal_WindowsAppImageBuilder + * Class: jdk_incubator_jpackage_internal_ExecutableRebrander * Method: versionSwap - * Signature: (Ljava/lang/String;Ljava/lang/String;)I + * Signature: (J;[Ljava/lang/String;)I */ JNIEXPORT jint JNICALL - Java_jdk_incubator_jpackage_internal_WindowsAppImageBuilder_versionSwap( - JNIEnv *pEnv, jclass c, jstring jExecutableProperties, - jstring jLauncher) { + Java_jdk_incubator_jpackage_internal_ExecutableRebrander_versionSwap( + JNIEnv *pEnv, jclass c, jlong jResourceLock, + jobjectArray jExecutableProperties) { + + JP_TRY; - wstring executableProperties = GetStringFromJString(pEnv, + const tstring_array props = jni::toUnicodeStringArray(pEnv, jExecutableProperties); - wstring launcher = GetStringFromJString(pEnv, jLauncher); - VersionInfoSwap vs(executableProperties, launcher); - if (vs.PatchExecutable()) { - return 0; + VersionInfo vi; + + tstring_array::const_iterator it = props.begin(); + tstring_array::const_iterator end = props.end(); + for (; it != end; ++it) { + const tstring name = *it; + const tstring value = *++it; + vi.setProperty(name, value); } + const ResourceEditor::FileLock lock(reinterpret_cast(jResourceLock)); + vi.apply(lock); + + return 0; + + JP_CATCH_ALL; + return 1; } /* * Class: jdk_incubator_jpackage_internal_WinExeBundler * Method: embedMSI - * Signature: (Ljava/lang/String;Ljava/lang/String;)I + * Signature: (J;Ljava/lang/String;)I */ JNIEXPORT jint JNICALL Java_jdk_incubator_jpackage_internal_WinExeBundler_embedMSI( - JNIEnv *pEnv, jclass c, jstring jexePath, jstring jmsiPath) { - - const wstring exePath = GetStringFromJString(pEnv, jexePath); - const wstring msiPath = GetStringFromJString(pEnv, jmsiPath); + JNIEnv *pEnv, jclass c, jlong jResourceLock, jstring jmsiPath) { JP_TRY; - ResourceEditor() - .id(L"msi") - .type(RT_RCDATA) - .apply(ResourceEditor::FileLock(exePath), msiPath); + const std::wstring msiPath = jni::toUnicodeString(pEnv, jmsiPath); + + const ResourceEditor::FileLock lock(reinterpret_cast(jResourceLock)); + ResourceEditor().id(L"msi").type(RT_RCDATA).apply(lock, msiPath); return 0; diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk15.test/src/org/graalvm/compiler/hotspot/jdk15/test/ClassReplacementsTest.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk15.test/src/org/graalvm/compiler/hotspot/jdk15/test/ClassReplacementsTest.java new file mode 100644 index 00000000000..c4818e55190 --- /dev/null +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.jdk15.test/src/org/graalvm/compiler/hotspot/jdk15/test/ClassReplacementsTest.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +package org.graalvm.compiler.hotspot.jdk15.test; + +import org.graalvm.compiler.replacements.test.MethodSubstitutionTest; +import org.junit.Test; + +import java.util.function.Supplier; + +/** + * As of JDK 15 {@code java.lang.Class::isHidden()} was added. + * + * @see "https://openjdk.java.net/jeps/371" + * @see "https://bugs.openjdk.java.net/browse/JDK-8238358" + */ +public class ClassReplacementsTest extends MethodSubstitutionTest { + + @SuppressWarnings("all") + public static boolean isHidden(Class clazz) { + return clazz.isHidden(); + } + + @Test + public void testIsHidden() { + testGraph("isHidden"); + + Supplier lambda = () -> () -> System.out.println("run"); + + for (Class c : new Class[]{getClass(), Cloneable.class, int[].class, String[][].class, lambda.getClass(), lambda.get().getClass()}) { + test("isHidden", c); + } + } + +} diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java index a20a8ddd46e..f2606a75a98 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java @@ -299,6 +299,7 @@ public final int arrayOopDescLengthOffset() { public final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class); public final int jvmAccWrittenFlags = getConstant("JVM_ACC_WRITTEN_FLAGS", Integer.class); public final int jvmAccSynthetic = getConstant("JVM_ACC_SYNTHETIC", Integer.class); + public final int jvmAccIsHiddenClass = getConstant("JVM_ACC_IS_HIDDEN_CLASS", Integer.class); public final int jvmciCompileStateCanPostOnExceptionsOffset = getJvmciJvmtiCapabilityOffset("_jvmti_can_post_on_exceptions"); public final int jvmciCompileStateCanPopFrameOffset = getJvmciJvmtiCapabilityOffset("_jvmti_can_pop_frame"); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java index 31761b73a3c..f3020cf3bfa 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java @@ -285,6 +285,10 @@ private static void registerClassPlugins(Plugins plugins, GraalHotSpotVMConfig c r.registerMethodSubstitution(HotSpotClassSubstitutions.class, "isPrimitive", Receiver.class); r.registerMethodSubstitution(HotSpotClassSubstitutions.class, "getSuperclass", Receiver.class); + if (config.jvmAccIsHiddenClass != 0) { + r.registerMethodSubstitution(HotSpotClassSubstitutions.class, "isHidden", Receiver.class); + } + if (config.getFieldOffset("ArrayKlass::_component_mirror", Integer.class, "oop", Integer.MAX_VALUE) != Integer.MAX_VALUE) { r.registerMethodSubstitution(HotSpotClassSubstitutions.class, "getComponentType", Receiver.class); } diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java index 49ac2c973bb..bd6ebc82349 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_MODIFIER_FLAGS_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_SUPER_KLASS_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayKlassComponentMirrorOffset; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.jvmAccIsHiddenClass; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.klassAccessFlagsOffset; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.klassIsArray; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.klassModifierFlagsOffset; @@ -80,6 +81,18 @@ public static boolean isInterface(final Class thisObj) { } } + @MethodSubstitution(isStatic = false, optional = true) + public static boolean isHidden(final Class thisObj) { + KlassPointer klass = ClassGetHubNode.readClass(thisObj); + if (klass.isNull()) { + // Class for primitive type + return false; + } else { + int accessFlags = klass.readInt(klassAccessFlagsOffset(INJECTED_VMCONFIG), KLASS_ACCESS_FLAGS_LOCATION); + return (accessFlags & (jvmAccIsHiddenClass(INJECTED_VMCONFIG))) != 0; + } + } + @MethodSubstitution(isStatic = false) public static boolean isArray(final Class thisObj) { KlassPointer klass = ClassGetHubNode.readClass(thisObj); diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java index 715efc2ac5f..e0be3868bfe 100644 --- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java +++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java @@ -361,6 +361,11 @@ public static int jvmAccWrittenFlags(@InjectedParameter GraalHotSpotVMConfig con return config.jvmAccWrittenFlags; } + @Fold + public static int jvmAccIsHiddenClass(@InjectedParameter GraalHotSpotVMConfig config) { + return config.jvmAccIsHiddenClass; + } + public static final LocationIdentity KLASS_LAYOUT_HELPER_LOCATION = new HotSpotOptimizingLocationIdentity("Klass::_layout_helper") { @Override public ValueNode canonicalizeRead(ValueNode read, AddressNode location, ValueNode object, CanonicalizerTool tool) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java index 24f5f9b9b04..e2b2aae691f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java @@ -328,7 +328,7 @@ protected void addUseInfo(List mems, Content heading, Content List members = mems; boolean printedUseTableHeader = false; if (members.size() > 0) { - Table useTable = new Table(HtmlStyle.useSummary) + Table useTable = new Table(HtmlStyle.useSummary, HtmlStyle.summaryTable) .setCaption(heading) .setRowScopeColumn(1) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java index b649ded21ff..6e213d228c7 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java @@ -120,10 +120,11 @@ protected void buildAllClassesFile() throws DocFileIOException { * @param content HtmlTree content to which the links will be added */ protected void addContents(Content content) { - Table table = new Table(HtmlStyle.typeSummary) + Table table = new Table(HtmlStyle.typeSummary, HtmlStyle.summaryTable) .setHeader(new TableHeader(contents.classLabel, contents.descriptionLabel)) .setRowScopeColumn(1) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast) + .setId("all-classes-table") .setDefaultTab(resources.getText("doclet.All_Classes")) .addTab(resources.interfaceSummary, utils::isInterface) .addTab(resources.classSummary, e -> utils.isOrdinaryClass((TypeElement)e)) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java index 996acae081b..a8bf3860790 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java @@ -104,8 +104,8 @@ protected void buildAllPackagesFile() throws DocFileIOException { * @param content HtmlTree content to which the links will be added */ protected void addPackages(Content content) { - Table table = new Table(HtmlStyle.packagesSummary) - .setCaption(getTableCaption(new StringContent(resources.packageSummary))) + Table table = new Table(HtmlStyle.packagesSummary, HtmlStyle.summaryTable) + .setCaption(new StringContent(resources.packageSummary)) .setHeader(new TableHeader(contents.packageLabel, contents.descriptionLabel)) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); for (PackageElement pkg : configuration.packages) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java index 073b8867bc1..cfe26b440c1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java @@ -164,7 +164,7 @@ public TableHeader getSummaryTableHeader(Element member) { @Override protected Table createSummaryTable() { - return new Table(HtmlStyle.memberSummary) + return new Table(HtmlStyle.memberSummary, HtmlStyle.summaryTable) .setCaption(getCaption()) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(1) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java index e5c50f86cc2..007ff9ebce8 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java @@ -257,11 +257,11 @@ protected void addClassUse(Content contentTree) { * @param contentTree the content tree to which the packages elements will be added */ protected void addPackageList(Content contentTree) { - Content caption = getTableCaption(contents.getContent( + Content caption = contents.getContent( "doclet.ClassUse_Packages.that.use.0", getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); - Table table = new Table(HtmlStyle.useSummary) + LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))); + Table table = new Table(HtmlStyle.useSummary, HtmlStyle.summaryTable) .setCaption(caption) .setHeader(getPackageTableHeader()) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -282,12 +282,12 @@ protected void addPackageAnnotationList(Content contentTree) { pkgToPackageAnnotations.isEmpty()) { return; } - Content caption = getTableCaption(contents.getContent( + Content caption = contents.getContent( "doclet.ClassUse_PackageAnnotation", getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement)))); + LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement))); - Table table = new Table(HtmlStyle.useSummary) + Table table = new Table(HtmlStyle.useSummary, HtmlStyle.summaryTable) .setCaption(caption) .setHeader(getPackageTableHeader()) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java index 394b9b1e311..53f85f07092 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java @@ -205,7 +205,7 @@ public void addConstantMembers(TypeElement typeElement, Collection deprList, String id, String h String tableSummary, TableHeader tableHeader, Content contentTree) { if (deprList.size() > 0) { Content caption = contents.getContent(headingKey); - Table table = new Table(HtmlStyle.deprecatedSummary) + Table table = new Table(HtmlStyle.deprecatedSummary, HtmlStyle.summaryTable) .setCaption(caption) .setHeader(tableHeader) .setId(id) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java index f64e5def089..63df3466d60 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java @@ -142,7 +142,7 @@ public TableHeader getSummaryTableHeader(Element member) { @Override protected Table createSummaryTable() { - return new Table(HtmlStyle.memberSummary) + return new Table(HtmlStyle.memberSummary, HtmlStyle.summaryTable) .setCaption(contents.getContent("doclet.Enum_Constants")) .setHeader(getSummaryTableHeader(typeElement)) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java index 20520463e97..f7a3c323114 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java @@ -147,7 +147,7 @@ protected Table createSummaryTable() { List bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); - return new Table(HtmlStyle.memberSummary) + return new Table(HtmlStyle.memberSummary, HtmlStyle.summaryTable) .setCaption(contents.fields) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(1) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index ca577676968..6fe553b19d7 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -516,21 +516,6 @@ protected Content getNavLinkMainTree(String label) { return li; } - /** - * Get table caption. - * - * @param title the content for the caption - * @return a content tree for the caption - */ - public Content getTableCaption(Content title) { - Content captionSpan = HtmlTree.SPAN(title); - Content space = Entity.NO_BREAK_SPACE; - Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space); - Content caption = HtmlTree.CAPTION(captionSpan); - caption.add(tabSpan); - return caption; - } - /** * Returns a packagename content. * diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java index 6775588f319..d41a3e0c6a9 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java @@ -191,10 +191,11 @@ public TableHeader getSummaryTableHeader(Element member) { @Override protected Table createSummaryTable() { - return new Table(HtmlStyle.memberSummary) + return new Table(HtmlStyle.memberSummary, HtmlStyle.summaryTable) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(1) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast) + .setId("method-summary-table") .setDefaultTab(resources.getText("doclet.All_Methods")) .addTab(resources.getText("doclet.Static_Methods"), utils::isStatic) .addTab(resources.getText("doclet.Instance_Methods"), e -> !utils.isStatic(e)) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java index f4309821fc4..546bd1ac418 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java @@ -91,9 +91,10 @@ protected void addIndex(Content main) { if (!groupModuleMap.keySet().isEmpty()) { TableHeader tableHeader = new TableHeader(contents.moduleLabel, contents.descriptionLabel); - Table table = new Table(HtmlStyle.overviewSummary) + Table table = new Table(HtmlStyle.overviewSummary, HtmlStyle.summaryTable) .setHeader(tableHeader) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast) + .setId("all-modules-table") .setDefaultTab(resources.getText("doclet.All_Modules")) .setTabScript(i -> "show(" + i + ");") .setTabId(i -> (i == 0) ? "t0" : ("t" + (1 << (i - 1)))); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java index d8edb49c26c..9ce512ddc64 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java @@ -456,7 +456,7 @@ public void addSummaryHeader(Content startMarker, Content heading, */ private Table getTable2(Content caption, HtmlStyle tableStyle, TableHeader tableHeader) { - return new Table(tableStyle) + return new Table(tableStyle, HtmlStyle.detailsTable) .setCaption(caption) .setHeader(tableHeader) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -473,7 +473,7 @@ private Table getTable2(Content caption, HtmlStyle tableStyle, */ private Table getTable3(Content caption, String tableSummary, HtmlStyle tableStyle, TableHeader tableHeader) { - return new Table(tableStyle) + return new Table(tableStyle, HtmlStyle.detailsTable) .setCaption(caption) .setHeader(tableHeader) .setRowScopeColumn(1) @@ -494,7 +494,7 @@ public void addModulesSummary(Content summariesList) { String tableSummary = resources.getText("doclet.Member_Table_Summary", text, resources.getText("doclet.modules")); - Content caption = getTableCaption(new StringContent(text)); + Content caption = new StringContent(text); Table table = getTable3(caption, tableSummary, HtmlStyle.requiresSummary, requiresTableHeader); addModulesList(requires, table); @@ -506,7 +506,7 @@ public void addModulesSummary(Content summariesList) { String amrTableSummary = resources.getText("doclet.Member_Table_Summary", amrText, resources.getText("doclet.modules")); - Content amrCaption = getTableCaption(new StringContent(amrText)); + Content amrCaption = new StringContent(amrText); Table amrTable = getTable3(amrCaption, amrTableSummary, HtmlStyle.requiresSummary, requiresTableHeader); addModulesList(indirectModules, amrTable); @@ -568,7 +568,8 @@ public void addPackagesSummary(Content summariesList) { * @param li */ public void addPackageSummary(HtmlTree li) { - Table table = new Table(HtmlStyle.packagesSummary) + Table table = new Table(HtmlStyle.packagesSummary, HtmlStyle.summaryTable) + .setId("package-summary-table") .setDefaultTab(resources.getText("doclet.All_Packages")) .addTab(resources.getText("doclet.Exported_Packages_Summary"), this::isExported) .addTab(resources.getText("doclet.Opened_Packages_Summary"), this::isOpened) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java index 0a87755f227..33777b63c98 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java @@ -95,7 +95,7 @@ protected Table createSummaryTable() { List bodyRowStyles = Arrays.asList(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast); - return new Table(HtmlStyle.memberSummary) + return new Table(HtmlStyle.memberSummary, HtmlStyle.summaryTable) .setCaption(contents.getContent("doclet.Nested_Classes")) .setHeader(getSummaryTableHeader(typeElement)) .setRowScopeColumn(1) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java index c5541a819f2..5a6311a1c45 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java @@ -92,9 +92,10 @@ protected void addIndex(Content main) { = configuration.group.groupPackages(packages); if (!groupPackageMap.keySet().isEmpty()) { - Table table = new Table(HtmlStyle.overviewSummary) + Table table = new Table(HtmlStyle.overviewSummary, HtmlStyle.summaryTable) .setHeader(getPackageTableHeader()) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast) + .setId("all-packages-table") .setDefaultTab(resources.getText("doclet.All_Packages")) .setTabScript(i -> "show(" + i + ");") .setTabId(i -> (i == 0) ? "t0" : ("t" + (1 << (i - 1)))); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java index fe0933abda5..93f6aa1a85b 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java @@ -165,7 +165,7 @@ protected void addPackageList(Content contentTree) { Content caption = contents.getContent( "doclet.ClassUse_Packages.that.use.0", getPackageLink(packageElement, utils.getPackageName(packageElement))); - Table table = new Table(HtmlStyle.useSummary) + Table table = new Table(HtmlStyle.useSummary, HtmlStyle.summaryTable) .setCaption(caption) .setHeader(getPackageTableHeader()) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); @@ -204,7 +204,7 @@ protected void addClassList(Content contentTree) { "doclet.ClassUse_Classes.in.0.used.by.1", getPackageLink(packageElement, utils.getPackageName(packageElement)), getPackageLink(usingPackage, utils.getPackageName(usingPackage))); - Table table = new Table(HtmlStyle.useSummary) + Table table = new Table(HtmlStyle.useSummary, HtmlStyle.summaryTable) .setCaption(caption) .setHeader(classTableHeader) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java index e2cdeaee79e..aaefb006da1 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java @@ -209,8 +209,8 @@ public void addAnnotationTypeSummary(SortedSet annoTypes, Content s public void addClassesSummary(SortedSet classes, String label, TableHeader tableHeader, Content summaryContentTree) { if(!classes.isEmpty()) { - Table table = new Table(HtmlStyle.typeSummary) - .setCaption(getTableCaption(new StringContent(label))) + Table table = new Table(HtmlStyle.typeSummary, HtmlStyle.summaryTable) + .setCaption(new StringContent(label)) .setHeader(tableHeader) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java index d190e1d34e3..b2265cb9f00 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java @@ -156,7 +156,7 @@ public TableHeader getSummaryTableHeader(Element member) { @Override protected Table createSummaryTable() { - return new Table(HtmlStyle.memberSummary) + return new Table(HtmlStyle.memberSummary, HtmlStyle.summaryTable) .setCaption(contents.properties) .setHeader(getSummaryTableHeader(typeElement)) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colSecond, HtmlStyle.colLast) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SystemPropertiesWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SystemPropertiesWriter.java index 56732b2ffa3..98c61974a35 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SystemPropertiesWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SystemPropertiesWriter.java @@ -134,8 +134,8 @@ protected void buildSystemPropertiesPage() throws DocFileIOException { protected void addSystemProperties(Content content) { Map> searchIndexMap = groupSystemProperties(); Content separator = new StringContent(", "); - Table table = new Table(HtmlStyle.systemPropertiesSummary) - .setCaption(getTableCaption(contents.systemPropertiesSummaryLabel)) + Table table = new Table(HtmlStyle.systemPropertiesSummary, HtmlStyle.summaryTable) + .setCaption(contents.systemPropertiesSummaryLabel) .setHeader(new TableHeader(contents.propertyLabel, contents.referencedIn)) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); for (Entry> entry : searchIndexMap.entrySet()) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java index 038880bbe2c..16c607956ea 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java @@ -46,18 +46,11 @@ */ public enum HtmlStyle { aboutLanguage, - activeTableTab, - altColor, block, blockList, bottomNav, circle, classUses, - colConstructorName, - colDeprecatedItemName, - colFirst, - colLast, - colSecond, constantsSummary, constructorDetails, constructorSummary, @@ -110,7 +103,6 @@ propertySummary, providesSummary, requiresSummary, - rowColor, searchTagLink, searchTagResult, serializedPackageContainer, @@ -125,8 +117,6 @@ summary, summaryList, systemPropertiesSummary, - tabEnd, - tableTab, title, topNav, typeNameLabel, @@ -136,6 +126,93 @@ usesSummary, verticalSeparator, + // + // The following constants are used for "summary" and "details" tables. + // Most tables are summary tables, meaning that, in part, they provide links to details elsewhere. + // A module page has details tables containing the details of the directives. + + /** + * The class of a {@code table} element used to present details of a program element. + */ + detailsTable, + + /** + * The class of a {@code table} element used to present a summary of the enclosed + * elements of a program element. A {@code summaryTable} typically references + * items in a corresponding {@link #detailsList}. + */ + summaryTable, + + /** + * The class of the "tab" that indicates the currently displayed contents of a table. + * This is used when the table provides filtered views. + */ + activeTableTab, + + /** + * The class of a "tab" that indicates an alternate view of the contents of a table. + * This is used when the table provides filtered views. + */ + tableTab, + + /** + * The class of the {@code div} element that contains the tabs used to select + * the contents of the associated table to be displayed. + */ + tableTabs, + + /** + * The class of the cells in a table column used to display the name + * of a constructor. + */ + colConstructorName, + + /** + * The class of the cells in a table column used to display the name + * of a deprecated item. + */ + colDeprecatedItemName, + + /** + * The class of the first column of cells in a table. + * This is typically the "type and modifiers" column, where the type is + * the type of a field or the return type of a method. + */ + colFirst, + + /** + * The class of the last column of cells in a table. + * This is typically the "description" column, where the description is + * the first sentence of the elemen ts documentation comment. + */ + colLast, + + /** + * The class of the second column of cells in a table. + * This is typically the column that defines the name of a field or the + * name and parameters of a method. + */ + colSecond, + + /** + * A class used to provide the background for the rows of a table, + * to provide a "striped" effect. This class and {@link #rowColor} + * are used on alternating rows. + * The classes are applied dynamically when table "tabs" are used + * to filter the set of rows to be displayed + */ + altColor, + + /** + * A class used to provide the background for the rows of a table, + * to provide a "striped" effect. This class and {@link #altColor} + * are used on alternating rows. + * The classes are applied dynamically when table "tabs" are used + * to filter the set of rows to be displayed + */ + rowColor, + // + // // The following constants are used for the components used to present the content // generated from documentation comments. diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java index d9d5d514142..14f8490f900 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Table.java @@ -54,20 +54,29 @@ * * Many methods return the current object, to facilitate fluent builder-style usage. * + * A table may support filtered views, which can be selected by clicking on + * one of a list of tabs above the table. If the table does not support filtered + * views, the {@code } element is typically displayed as a single (inactive) + * tab. + * + * Tables are always enclosed in a {@code

      } element, which will also contain + * a {@code
      } element for the list of tabs, when the table supports filtered views. + * *

      This is NOT part of any supported API. * If you write code that depends on this, you do so at your own risk. * This code and its internal interfaces are subject to change or * deletion without notice. */ public class Table extends Content { + private final HtmlStyle topStyle; private final HtmlStyle tableStyle; private Content caption; private Map> tabMap; private String defaultTab; private Set tabs; + private HtmlStyle tabListStyle = HtmlStyle.tableTabs; private HtmlStyle activeTabStyle = HtmlStyle.activeTableTab; private HtmlStyle tabStyle = HtmlStyle.tableTab; - private HtmlStyle tabEnd = HtmlStyle.tabEnd; private IntFunction tabScript; private Function tabId = (i -> "t" + i); private TableHeader header; @@ -82,10 +91,12 @@ /** * Creates a builder for an HTML table. * - * @param style the style class for the {@code } tag + * @param topStyle the style class for the top-level {@code
      } element + * @param tableStyle the style class for the {@code
      } element */ - public Table(HtmlStyle style) { - this.tableStyle = style; + public Table(HtmlStyle topStyle, HtmlStyle tableStyle) { + this.topStyle = topStyle; + this.tableStyle = tableStyle; bodyRows = new ArrayList<>(); bodyRowMasks = new ArrayList<>(); } @@ -97,20 +108,11 @@ public Table(HtmlStyle style) { * The caption should be suitable for use as the content of a {@code * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * *
      } * element. * - * For compatibility, the code currently accepts a {@code } element - * as well. This should be removed when all clients rely on using the {@code } - * element being generated by this class. - * * @param captionContent the caption * @return this object */ public Table setCaption(Content captionContent) { - if (captionContent instanceof HtmlTree - && ((HtmlTree) captionContent).tagName == TagName.CAPTION) { - caption = captionContent; - } else { - caption = getCaption(captionContent); - } + caption = getCaption(captionContent); return this; } @@ -161,15 +163,15 @@ public Table setTabScript(IntFunction f) { /** * Sets the name of the styles used to display the tabs. * + * @param tabListStyle the style for the {@code
      } element containing the tabs * @param activeTabStyle the style for the active tab * @param tabStyle the style for other tabs - * @param tabEnd the style for the padding that appears within each tab * @return this object */ - public Table setTabStyles(HtmlStyle activeTabStyle, HtmlStyle tabStyle, HtmlStyle tabEnd) { + public Table setTabStyles(HtmlStyle tabListStyle, HtmlStyle activeTabStyle, HtmlStyle tabStyle) { + this.tabListStyle = tabListStyle; this.activeTabStyle = activeTabStyle; this.tabStyle = tabStyle; - this.tabEnd = tabEnd; return this; } @@ -279,6 +281,9 @@ public Table setRowIdPrefix(String prefix) { /** * Sets the id attribute of the table. + * This is required if the table has tabs, in which case a subsidiary id + * will be generated for the tabpanel. This subsidiary id is required for + * the ARIA support. * * @param id the id * @return this object @@ -411,12 +416,11 @@ public boolean write(Writer out, boolean atNewline) throws IOException { * @return the HTML */ private Content toContent() { - HtmlTree mainDiv = new HtmlTree(TagName.DIV); - mainDiv.setStyle(tableStyle); + HtmlTree mainDiv = new HtmlTree(TagName.DIV).setStyle(topStyle); if (id != null) { mainDiv.setId(id); } - HtmlTree table = new HtmlTree(TagName.TABLE); + HtmlTree table = new HtmlTree(TagName.TABLE).setStyle(tableStyle); if (tabMap == null || tabs.size() == 1) { if (tabMap == null) { table.add(caption); @@ -427,7 +431,7 @@ private Content toContent() { table.add(getTableBody()); mainDiv.add(table); } else { - HtmlTree tablist = new HtmlTree(TagName.DIV) + HtmlTree tablist = new HtmlTree(TagName.DIV).setStyle(tabListStyle) .put(HtmlAttr.ROLE, "tablist") .put(HtmlAttr.ARIA_ORIENTATION, "horizontal"); @@ -443,8 +447,11 @@ private Content toContent() { tablist.add(tab); } } + if (id == null) { + throw new IllegalStateException("no id set for table"); + } HtmlTree tabpanel = new HtmlTree(TagName.DIV) - .put(HtmlAttr.ID, tableStyle.cssName() + "_tabpanel") + .put(HtmlAttr.ID, id + ".tabpanel") .put(HtmlAttr.ROLE, "tabpanel"); table.add(getTableBody()); tabpanel.add(table); @@ -458,7 +465,7 @@ private HtmlTree createTab(String tabId, HtmlStyle style, boolean defaultTab, St HtmlTree tab = new HtmlTree(TagName.BUTTON) .put(HtmlAttr.ROLE, "tab") .put(HtmlAttr.ARIA_SELECTED, defaultTab ? "true" : "false") - .put(HtmlAttr.ARIA_CONTROLS, tableStyle.cssName() + "_tabpanel") + .put(HtmlAttr.ARIA_CONTROLS, id + ".tabpanel") .put(HtmlAttr.TABINDEX, defaultTab ? "0" : "-1") .put(HtmlAttr.ONKEYDOWN, "switchTab(event)") .put(HtmlAttr.ID, tabId) @@ -550,7 +557,6 @@ private void appendStyleInfo(StringBuilder sb, HtmlStyle... styles) { private HtmlTree getCaption(Content title) { return new HtmlTree(TagName.CAPTION) - .add(HtmlTree.SPAN(title)) - .add(HtmlTree.SPAN(tabEnd, Entity.NO_BREAK_SPACE)); + .add(HtmlTree.SPAN(title)); } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script-dir/jquery-ui.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script-dir/jquery-ui.css index c4487b41cdb..4cb963a6c7f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script-dir/jquery-ui.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script-dir/jquery-ui.css @@ -251,7 +251,7 @@ a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover { border: 1px solid #aaaaaa; - background: #dadada url("images/ui-bg_glass_65_dadada_1x400.png") 50% 50% repeat-x; + background: #F8981D; font-weight: normal; color: #212121; } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css index aabf79cce24..79a9d970c8b 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css @@ -409,34 +409,25 @@ table tr td dl, table tr td dl dt, table tr td dl dd { border: none; height:16px; } -.overview-summary .tab-end, .member-summary .tab-end, .type-summary .tab-end, -.use-summary .tab-end, .constants-summary .tab-end, .deprecated-summary .tab-end, -.requires-summary .tab-end, .packages-summary .tab-end, .provides-summary .tab-end, .uses-summary .tab-end { - display:none; - width:5px; - position:relative; - float:left; - background-color:#F8981D; -} -.overview-summary [role=tablist] button, .member-summary [role=tablist] button, -.type-summary [role=tablist] button, .packages-summary [role=tablist] button { + +div.table-tabs > button { border: none; cursor: pointer; padding: 5px 12px 7px 12px; font-weight: bold; margin-right: 3px; } -.overview-summary [role=tablist] .active-table-tab, .member-summary [role=tablist] .active-table-tab, -.type-summary [role=tablist] .active-table-tab, .packages-summary [role=tablist] .active-table-tab { +div.table-tabs > button.active-table-tab { background: #F8981D; color: #253441; } -.overview-summary [role=tablist] .table-tab, .member-summary [role=tablist] .table-tab, -.type-summary [role=tablist] .table-tab, .packages-summary [role=tablist] .table-tab { +div.table-tabs > button.table-tab { background: #4D7A97; color: #FFFFFF; } -.row-color th, .alt-color th { + +.row-color th, +.alt-color th { font-weight:normal; } .overview-summary td, .member-summary td, .type-summary td, diff --git a/src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java b/src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java index f530e325ab7..9b070cae795 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,24 +46,22 @@ *

      * The following example shows how {@code AnnotationElement} can be used to dynamically define events. * - *

      - * 
      - *   List{@literal <}AnnotationElement{@literal >} typeAnnotations = new ArrayList{@literal <}{@literal >}();
      - *   typeannotations.add(new AnnotationElement(Name.class, "com.example.HelloWorld");
      + * 
      {@literal
      + *   List typeAnnotations = new ArrayList<>();
      + *   typeAnnotations.add(new AnnotationElement(Name.class, "com.example.HelloWorld"));
        *   typeAnnotations.add(new AnnotationElement(Label.class, "Hello World"));
        *   typeAnnotations.add(new AnnotationElement(Description.class, "Helps programmer getting started"));
        *
      - *   List{@literal <}AnnotationElement{@literal >} fieldAnnotations = new ArrayList{@literal <}{@literal >}();
      + *   List fieldAnnotations = new ArrayList<>();
        *   fieldAnnotations.add(new AnnotationElement(Label.class, "Message"));
        *
      - *   List{@literal <}ValueDescriptor{@literal >} fields = new ArrayList{@literal <}{@literal >}();
      + *   List fields = new ArrayList<>();
        *   fields.add(new ValueDescriptor(String.class, "message", fieldAnnotations));
        *
        *   EventFactory f = EventFactory.create(typeAnnotations, fields);
        *   Event event = f.newEvent();
        *   event.commit();
      - * 
      - * 
      + * }
      * * @since 9 */ @@ -357,7 +355,7 @@ public boolean hasValue(String name) { * @param annotationType the {@code Class object} corresponding to the annotation type, * not {@code null} * @return this element's annotation for the specified annotation type if - * it it exists, else {@code null} + * it exists, else {@code null} */ public final A getAnnotation(Class annotationType) { Objects.requireNonNull(annotationType); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java b/src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java index 06b32ef0d0a..6fc92ceab34 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ /** * Event field annotation, specifies that the value is a boolean flag, a {@code true} or - * {@code false} value + * {@code false} value. * * @since 9 */ diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Category.java b/src/jdk.jfr/share/classes/jdk/jfr/Category.java index 91f6807057e..9b7e2c4b968 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/Category.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/Category.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,32 +75,32 @@ *
      1File Upload@Category("Upload"){@code @Category("Upload")}
      2Image Read@Category({"Upload", "Image Upload"}){@code @Category({"Upload", "Image Upload"})}
      2Image Resize@Category({"Upload", "Image Upload"}){@code @Category({"Upload", "Image Upload"})}
      2Image Write@Category({"Upload", "Image Upload"}){@code @Category({"Upload", "Image Upload"})}
      3Socket Read@Category("Java Application"){@code @Category("Java Application")}
      3File Write@Category("Java Application"){@code @Category("Java Application")}
      diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Event.java b/src/jdk.jfr/share/classes/jdk/jfr/Event.java index 9a6ddaa02f4..0d303df6309 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/Event.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/Event.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,18 +31,17 @@ *

      * The following example shows how to implement an {@code Event} class. * - *

      - * 
      + * 
      {@literal
        * import jdk.jfr.Event;
        * import jdk.jfr.Description;
        * import jdk.jfr.Label;
        *
        * public class Example {
        *
      - *   @Label("Hello World")
      - *   @Description("Helps programmer getting started")
      + *   @Label("Hello World")
      + *   @Description("Helps programmer getting started")
        *   static class HelloWorld extends Event {
      - *       @Label("Message")
      + *       @Label("Message")
        *       String message;
        *   }
        *
      @@ -52,11 +51,10 @@
        *       event.commit();
        *   }
        * }
      - * 
      - * 
      + * }
      *

      * After an event is allocated and its field members are populated, it can be - * written to the Flight Recorder system by using the {@code #commit()} method. + * written to the Flight Recorder system by using the {@link #commit()} method. *

      * By default, an event is enabled. To disable an event annotate the * {@link Event} class with {@code @Enabled(false)}. @@ -79,8 +77,8 @@ * Gathering data to store in an event can be expensive. The * {@link Event#shouldCommit()} method can be used to verify whether an event * instance would actually be written to the system when the - * {@code Event#commit()commit} method is invoked. If - * {@link Event#shouldCommit()} returns false, then those operations can be + * {@code commit()} method is invoked. If + * {@code shouldCommit()} returns false, then those operations can be * avoided. * * @since 9 @@ -156,7 +154,7 @@ final public boolean shouldCommit() { * {@code EventFactory} class. * * @param index the index of the field that is passed to - * {@code EventFactory#create(String, java.util.List, java.util.List)} + * {@link EventFactory#create(java.util.List, java.util.List)} * @param value value to set, can be {@code null} * @throws UnsupportedOperationException if it's not a dynamically generated * event diff --git a/src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java b/src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java index b4ccb5f50b7..bbda1be7490 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -171,7 +171,7 @@ public static EventFactory create(List annotationElements, Li try { return new EventFactory(eventClass, sanitizedAnnotation, sanitizedFields); } catch (IllegalAccessException e) { - throw new IllegalAccessError("Could not accees constructor of generated event handler, " + e.getMessage()); + throw new IllegalAccessError("Could not access constructor of generated event handler, " + e.getMessage()); } catch (NoSuchMethodException e) { throw new InternalError("Could not find constructor in generated event handler, " + e.getMessage()); } @@ -189,7 +189,7 @@ public Event newEvent() { try { return (Event) constructorHandle.invoke(); } catch (Throwable e) { - throw new InstantiationError("Could not instantaite dynamically generated event class " + eventClass.getName() + ". " + e.getMessage()); + throw new InstantiationError("Could not instantiate dynamically generated event class " + eventClass.getName() + ". " + e.getMessage()); } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/EventType.java b/src/jdk.jfr/share/classes/jdk/jfr/EventType.java index e67489becc3..cb06717aa28 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/EventType.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/EventType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,10 +67,8 @@ * Returns the field with the specified name, or {@code null} if it doesn't * exist. * - * @return a value descriptor that describes the field, or null if + * @return a value descriptor that describes the field, or {@code null} if * the field with the specified name doesn't exist - * - * @return a value descriptor, or null if it doesn't exist */ public ValueDescriptor getField(String name) { Objects.requireNonNull(name); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java b/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java index ae9371c1196..eb9459e8bcb 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java @@ -85,7 +85,7 @@ private FlightRecorder(PlatformRecorder internal) { /** * Creates a snapshot of all available recorded data. *

      - * A snapshot is a synthesized recording in a {@code STOPPPED} state. If no data is + * A snapshot is a synthesized recording in a {@code STOPPED} state. If no data is * available, a recording with size {@code 0} is returned. *

      * A snapshot provides stable access to data for later operations (for example, @@ -93,17 +93,15 @@ private FlightRecorder(PlatformRecorder internal) { *

      * The following example shows how to create a snapshot and write a subset of the data to a file. * - *

      -     * 
      +     * 
      {@literal
            * try (Recording snapshot = FlightRecorder.getFlightRecorder().takeSnapshot()) {
      -     *   if (snapshot.getSize() > 0) {
      +     *   if (snapshot.getSize() > 0) {
            *     snapshot.setMaxSize(100_000_000);
            *     snapshot.setMaxAge(Duration.ofMinutes(5));
            *     snapshot.dump(Paths.get("snapshot.jfr"));
            *   }
            * }
      -     * 
      -     * 
      + * }
      * * The caller must close the recording when access to the data is no longer * needed. diff --git a/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java b/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java index cda440f36d0..55798f89de4 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,12 +41,12 @@ *

      * This method allows clients to implement their own initialization mechanism * that is executed before a {@code FlightRecorder} instance is returned by - * {@code FlightRecorder#getFlightRecorder()}. + * {@link FlightRecorder#getFlightRecorder()}. * * @implNote This method should return as soon as possible, to avoid blocking * initialization of Flight Recorder. To avoid deadlocks or unexpected * behavior, this method should not call - * {@link FlightRecorder#getFlightRecorder()} or start new recordings. + * {@code FlightRecorder.getFlightRecorder()} or start new recordings. * * @implSpec The default implementation of this method is empty. * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java b/src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java index 826346da0ef..919c7b01cff 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,39 +36,36 @@ * In the following example, a transaction event is defined with two * user-defined annotations, {@code @Severity} and {@code @TransactionId}. * - *

      - * 
      - *{@literal @}MetadataDefinition
      - *{@literal @}Label("Severity")
      - *{@literal @}Description("Value between 0 and 100 that indicates severity. 100 is most severe.")
      - *{@literal @}Retention(RetentionPolicy.RUNTIME)
      - *{@literal @}Target({ ElementType.TYPE })
      - * public {@literal @}interface {@literal @}Severity {
      - *   int value() default 50;
      + * 
      {@literal
      + * @MetadataDefinition
      + * @Label("Severity")
      + * @Description("Value between 0 and 100 that indicates severity. 100 is most severe.")
      + * @Retention(RetentionPolicy.RUNTIME)
      + * @Target({ElementType.TYPE})
      + * public @interface Severity {
      + *     int value() default 50;
        * }
        *
      - *{@literal @}MetadataDefinition
      - *{@literal @}Label("Transaction Id")
      - *{@literal @}Relational
      - *{@literal @}Retention(RetentionPolicy.RUNTIME)
      - *{@literal @}Target({ ElementType.FIELD })
      - * public {@literal @}interface {@literal @}Severity {
      + * @MetadataDefinition
      + * @Label("Transaction Id")
      + * @Relational
      + * @Retention(RetentionPolicy.RUNTIME)
      + * @Target({ElementType.FIELD})
      + * public @interface TransactionId {
        * }
        *
      - *{@literal @}Severity(80)
      - *{@literal @}Label("Transaction Blocked");
      + * @Severity(80)
      + * @Label("Transaction Blocked")
        * class TransactionBlocked extends Event {
      - *  {@literal @}TransactionId
      - *  {@literal @}Label("Transaction");
      - *   long transactionId;
      + *     @TransactionId
      + *     @Label("Transaction")
      + *     long transactionId1;
        *
      - *  {@literal @}TransactionId
      - *  {@literal @}Label("Transaction Blocker");
      - *   long transactionId;
      + *     @TransactionId
      + *     @Label("Transaction Blocker")
      + *     long transactionId2;
        * }
      - *
      - * 
      - * 
      + * }
      * * Adding {@code @MetadataDefinition} to the declaration of {@code @Severity} and {@code @TransactionId} * ensures the information is saved by Flight Recorder. diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Period.java b/src/jdk.jfr/share/classes/jdk/jfr/Period.java index 4fa32c39023..8e3aa10e660 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/Period.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/Period.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ *

      * Example values: {@code "0 ns"}, {@code "10 ms"}, and {@code "1 s"}. *

      - * A period may also be "everyChunk" to specify that it occurs at + * A period may also be {@code "everyChunk"} to specify that it occurs at * least once for every recording file. The number of events that are emitted * depends on how many times the file rotations occur when data is recorded. * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Recording.java b/src/jdk.jfr/share/classes/jdk/jfr/Recording.java index 10aeefa4f62..84b22227a4c 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/Recording.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/Recording.java @@ -46,8 +46,7 @@ *

      * The following example shows how configure, start, stop and dump recording data to disk. * - *

      - * 
      + * 
      {@literal
        *   Configuration c = Configuration.getConfiguration("default");
        *   Recording r = new Recording(c);
        *   r.start();
      @@ -55,8 +54,7 @@
        *   Thread.sleep(5000);
        *   r.stop();
        *   r.dump(Files.createTempFile("my-recording", ".jfr"));
      - * 
      - * 
      + * }
      * * @since 9 */ @@ -145,11 +143,9 @@ public Recording() { *

      * The following example shows how create a recording that uses a predefined configuration. * - *

      -     * 
      +     * 
      {@literal
            * Recording r = new Recording(Configuration.getConfiguration("default"));
      -     * 
      -     * 
      + * }
      * * The newly created recording is in the {@link RecordingState#NEW} state. To * start the recording, invoke the {@link Recording#start()} method. @@ -269,7 +265,7 @@ public Instant getStopTime() { /** * Returns the time when this recording was started. * - * @return the the time, or {@code null} if this recording is not started + * @return the time, or {@code null} if this recording is not started */ public Instant getStartTime() { return internal.getStartTime(); @@ -311,25 +307,21 @@ public String getName() { *

      * The following example shows how to set event settings for a recording. * - *

      -     * 
      -     *     Map{@literal <}String, String{@literal >} settings = new HashMap{@literal <}{@literal >}();
      +     * 
      {@literal
      +     *     Map settings = new HashMap<>();
            *     settings.putAll(EventSettings.enabled("jdk.CPUSample").withPeriod(Duration.ofSeconds(2)).toMap());
            *     settings.putAll(EventSettings.enabled(MyEvent.class).withThreshold(Duration.ofSeconds(2)).withoutStackTrace().toMap());
            *     settings.put("jdk.ExecutionSample#period", "10 ms");
            *     recording.setSettings(settings);
      -     * 
      -     * 
      + * }
      * * The following example shows how to merge settings. * - *
      -     *     {@code
      +     * 
      {@literal
            *     Map settings = recording.getSettings();
            *     settings.putAll(additionalSettings);
            *     recording.setSettings(settings);
      -     * }
      -     * 
      + * }
      * * @param settings the settings to set, not {@code null} */ @@ -421,7 +413,7 @@ public boolean isToDisk() { * * @param maxSize the amount of data to retain, {@code 0} if infinite * - * @throws IllegalArgumentException if maxSize is negative + * @throws IllegalArgumentException if {@code maxSize} is negative * * @throws IllegalStateException if the recording is in {@code CLOSED} state */ @@ -474,7 +466,7 @@ public void setMaxSize(long maxSize) { * * @param maxAge the length of time that data is kept, or {@code null} if infinite * - * @throws IllegalArgumentException if maxAge is negative + * @throws IllegalArgumentException if {@code maxAge} is negative * * @throws IllegalStateException if the recording is in the {@code CLOSED} state */ @@ -586,10 +578,10 @@ public void setToDisk(boolean disk) { *

      * The stream may contain some data outside the specified range. * - * @param the start start time for the stream, or {@code null} to get data from + * @param start the start time for the stream, or {@code null} to get data from * start time of the recording * - * @param the end end time for the stream, or {@code null} to get data until the + * @param end the end time for the stream, or {@code null} to get data until the * present time. * * @return an input stream, or {@code null} if no data is available in the diff --git a/src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java b/src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java index cd5609d624c..98e36e0963e 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,7 +65,7 @@ * recording are released. *

      * Nothing that can be done with a recording from this point, and it's - * no longer retrievable from the {@code FlightRrecorder.getRecordings()} method. + * no longer retrievable from the {@link FlightRecorder#getRecordings()} method. */ CLOSED; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java b/src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java index 8f0a44fb494..04ac74529d6 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,32 +36,30 @@ * The following example shows a naive implementation of a setting control for * regular expressions: * - *

      - * 
      + * 
      {@literal
        * final class RegExpControl extends SettingControl {
        *   private Pattern pattern = Pattern.compile(".*");
        *
      - *   {@literal @}Override
      + *   @Override
        *   public void setValue(String value) {
        *     this.pattern = Pattern.compile(value);
        *   }
        *
      - *   {@literal @}Override
      - *   public String combine(Set{@literal <}String{@literal >} values) {
      + *   @Override
      + *   public String combine(Set values) {
        *     return String.join("|", values);
        *   }
        *
      - *   {@literal @}Override
      + *   @Override
        *   public String getValue() {
        *     return pattern.toString();
        *   }
        *
      - *   public String matches(String s) {
      + *   public boolean matches(String s) {
        *     return pattern.matcher(s).find();
        *   }
        * }
      - * 
      - * 
      + * }
      * * The {@code setValue(String)}, {@code getValue()} and * {@code combine(Set)} methods are invoked when a setting value @@ -86,28 +84,27 @@ * The following example shows how to create an event that uses the * regular expression filter defined above. * - *
      - * 
      + * 
      {@literal
        * abstract class HTTPRequest extends Event {
      - *   {@literal @}Label("Request URI")
      + *   @Label("Request URI")
        *   protected String uri;
        *
      - *   {@literal @}Label("Servlet URI Filter")
      - *   {@literal @}SettingDefinition
      + *   @Label("Servlet URI Filter")
      + *   @SettingDefinition
        *   protected boolean uriFilter(RegExpControl regExp) {
        *     return regExp.matches(uri);
        *   }
        * }
        *
      - * {@literal @}Label("HTTP Get Request")
      + * @Label("HTTP Get Request")
        * class HTTPGetRequest extends HTTPRequest {
        * }
        *
      - * {@literal @}Label("HTTP Post Request")
      + * @Label("HTTP Post Request")
        * class HTTPPostRequest extends HTTPRequest {
        * }
        *
      - * class ExampleServlet extends HTTPServlet {
      + * class ExampleServlet extends HttpServlet {
        *   protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
        *     HTTPGetRequest request = new HTTPGetRequest();
        *     request.begin();
      @@ -124,22 +121,18 @@
        *     request.commit();
        *   }
        * }
      - * 
      - * 
      + * }
      * + *

      * The following example shows how an event can be filtered by assigning the * {@code "uriFilter"} setting with the specified regular expressions. * - *

      - * 
      + * 
      {@literal
        * Recording r = new Recording();
        * r.enable("HTTPGetRequest").with("uriFilter", "https://www.example.com/list/.*");
        * r.enable("HTTPPostRequest").with("uriFilter", "https://www.example.com/login/.*");
        * r.start();
      - * 
      - * 
      - * - * + * }
      * * @see SettingDefinition * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java b/src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java index 849bf5de5a8..7eae00c1f3e 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,21 +41,19 @@ *

      * The following example shows how to annotate a method in an event class. * - *

      - * 
      - * class HelloWorld extend Event {
      + * 
      {@literal
      + * class HelloWorld extends Event {
        *
      - *   {@literal @}Label("Message");
      + *   @Label("Message")
        *   String message;
        *
      - *   {@literal @}SettingDefinition;
      - *   {@literal @}Label("Message Filter");
      + *   @SettingDefinition
      + *   @Label("Message Filter")
        *   public boolean filter(RegExpControl regExp) {
        *     return regExp.matches(message);
        *   }
        * }
      - * 
      - * 
      + * }
      * * For an example of how the setting controls are defined, see * {@link SettingControl}. diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Timespan.java b/src/jdk.jfr/share/classes/jdk/jfr/Timespan.java index bcf5b2a2677..7989306b375 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/Timespan.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/Timespan.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ *

      * By default, the unit is nanoseconds. * - * @return the time span unit, default {@code #NANOSECONDS}, not {@code null} + * @return the time span unit, default {@link #NANOSECONDS}, not {@code null} */ String value() default NANOSECONDS; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java index eda0331ce23..c8789826016 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,15 +87,14 @@ *

      * If an unexpected exception occurs in an action, it is possible to catch the * exception in an error handler. An error handler can be registered using the - * {@link #onError(Runnable)} method. If no error handler is registered, the + * {@link #onError(Consumer)} method. If no error handler is registered, the * default behavior is to print the exception and its backtrace to the standard * error stream. *

      * The following example shows how an {@code EventStream} can be used to listen * to events on a JVM running Flight Recorder * - *

      - * 
      + * 
      {@literal
        * try (var es = EventStream.openRepository()) {
        *   es.onEvent("jdk.CPULoad", event -> {
        *     System.out.println("CPU Load " + event.getEndTime());
      @@ -113,8 +112,7 @@
        *   });
        *   es.start();
        * }
      - * 
      - * 
      + * }
      *

      * To start recording together with the stream, see {@link RecordingStream}. * @@ -139,7 +137,7 @@ */ public static EventStream openRepository() throws IOException { Utils.checkAccessFlightRecorder(); - return new EventDirectoryStream(AccessController.getContext(), null, SecuritySupport.PRIVILIGED, null); + return new EventDirectoryStream(AccessController.getContext(), null, SecuritySupport.PRIVILEGED, null); } /** @@ -162,7 +160,7 @@ public static EventStream openRepository() throws IOException { public static EventStream openRepository(Path directory) throws IOException { Objects.nonNull(directory); AccessControlContext acc = AccessController.getContext(); - return new EventDirectoryStream(acc, directory, FileAccess.UNPRIVILIGED, null); + return new EventDirectoryStream(acc, directory, FileAccess.UNPRIVILEGED, null); } /** @@ -213,7 +211,7 @@ static EventStream openFile(Path file) throws IOException { /** * Registers an action to perform if an exception occurs. *

      - * if an action is not registered, an exception stack trace is printed to + * If an action is not registered, an exception stack trace is printed to * standard error. *

      * Registering an action overrides the default behavior. If multiple actions @@ -273,7 +271,7 @@ static EventStream openFile(Path file) throws IOException { * Specifies that the event object in an {@link #onEvent(Consumer)} action * can be reused. *

      - * If reuse is set to {@code true), an action should not keep a reference + * If reuse is set to {@code true}, an action should not keep a reference * to the event object after the action has completed. * * @param reuse {@code true} if an event object can be reused, {@code false} @@ -286,7 +284,7 @@ static EventStream openFile(Path file) throws IOException { * they were committed to the stream. * * @param ordered if event objects arrive in chronological order to - * {@code #onEvent(Consumer)} + * {@link #onEvent(Consumer)} */ void setOrdered(boolean ordered); @@ -321,22 +319,22 @@ static EventStream openFile(Path file) throws IOException { void setEndTime(Instant endTime); /** - * Start processing of actions. + * Starts processing of actions. *

      * Actions are performed in the current thread. *

      - * To stop the stream, use the {@code #close()} method. + * To stop the stream, use the {@link #close()} method. * * @throws IllegalStateException if the stream is already started or closed */ void start(); /** - * Start asynchronous processing of actions. + * Starts asynchronous processing of actions. *

      * Actions are performed in a single separate thread. *

      - * To stop the stream, use the {@code #close()} method. + * To stop the stream, use the {@link #close()} method. * * @throws IllegalStateException if the stream is already started or closed */ diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java index f82e7adb055..8d6b5647f2f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ package jdk.jfr.consumer; -import java.lang.reflect.Modifier; - import jdk.jfr.internal.consumer.ObjectContext; /** @@ -45,12 +43,10 @@ /** * Returns the modifiers of the class. - *

      - * See {@link java.lang.reflect.Modifier} * * @return the modifiers * - * @see Modifier + * @see java.lang.reflect.Modifier */ public int getModifiers() { return getTyped("modifiers", Integer.class, -1); @@ -58,7 +54,7 @@ public int getModifiers() { /** * Returns the class loader that defined the class. - *

      + *

      * If the bootstrap class loader is represented as {@code null} in the Java * Virtual Machine (JVM), then {@code null} is also the return value of this method. * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java index d22818d2856..ab99b1d71b9 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ /** * Returns the class of the class loader. - *

      + *

      * If the bootstrap class loader is represented as {@code null} in the Java * Virtual Machine (JVM), then {@code null} is also the return value of this * method. diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java index 0bd9232067d..a82b43ffc36 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,13 +72,12 @@ public String getName() { * Returns the method descriptor for this method (for example, * {@code "(Ljava/lang/String;)V"}). *

      - * See Java Virtual Machine Specification, 4.3 - *

      - * If this method doesn't belong to a Java frame then the the result is undefined. + * If this method doesn't belong to a Java frame then the result is undefined. * - * @return method descriptor. + * @return method descriptor * * @see RecordedFrame#isJavaFrame() + * @jvms 4.3 Descriptors */ public String getDescriptor() { return getTyped("descriptor", String.class, null); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java index 87fd16c8e68..07d9d4161cb 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -182,7 +182,7 @@ Object value() { * * @param name name of the field to get, not {@code null} * - * @return {@code true} if the field exists, {@code false} otherwise. + * @return {@code true} if the field exists, {@code false} otherwise * * @see #getFields() */ @@ -222,8 +222,7 @@ public boolean hasField(String name) { *

      * Example * - *

      -     * 
      +     * 
      {@literal
            * if (event.hasField("intValue")) {
            *   int intValue = event.getValue("intValue");
            *   System.out.println("Int value: " + intValue);
      @@ -236,10 +235,9 @@ public boolean hasField(String name) {
            *
            * if (event.hasField("sampledThread")) {
            *   RecordedThread sampledThread = event.getValue("sampledThread");
      -     *   System.out.println("Sampled thread: " + sampledThread.getName());
      +     *   System.out.println("Sampled thread: " + sampledThread.getJavaName());
            * }
      -     * 
      -     * 
      + * }
      * * @param the return type * @param name of the field to get, not {@code null} diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThread.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThread.java index 73a6d8bc87d..97f4ec90530 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThread.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,7 +70,7 @@ public RecordedThreadGroup getThreadGroup() { } /** - * Returns the Java thread name, or {@code null} if if doesn't exist. + * Returns the Java thread name, or {@code null} if doesn't exist. *

      * Returns {@code java.lang.Thread.getName()} if the thread has a Java * representation. {@code null} otherwise. diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java index d5ad5bc965a..1d4234e76a9 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ public String getName() { /** * Returns the parent thread group, or {@code null} if it doesn't exist. * - * @return parent thread group, or {@code null} if it doesn't exist. + * @return parent thread group, or {@code null} if it doesn't exist */ public RecordedThreadGroup getParent() { return getTyped("parent", RecordedThreadGroup.class, null); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java index 96b7a8ac622..7d94a72281d 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,16 +48,14 @@ *

      * The following example shows how read and print all events in a recording file. * - *

      - * 
      + * 
      {@literal
        * try (RecordingFile recordingFile = new RecordingFile(Paths.get("recording.jfr"))) {
        *   while (recordingFile.hasMoreEvents()) {
        *     RecordedEvent event = recordingFile.readEvent();
        *     System.out.println(event);
        *   }
        * }
      - * 
      - * 
      + * }
      * * @since 9 */ @@ -83,7 +81,7 @@ */ public RecordingFile(Path file) throws IOException { this.file = file.toFile(); - this.input = new RecordingInput(this.file, FileAccess.UNPRIVILIGED); + this.input = new RecordingInput(this.file, FileAccess.UNPRIVILEGED); findNext(); } @@ -93,7 +91,7 @@ public RecordingFile(Path file) throws IOException { * @return the next event, not {@code null} * * @throws EOFException if no more events exist in the recording file - * @throws IOException if an I/O error occurs. + * @throws IOException if an I/O error occurs * * @see #hasMoreEvents() */ @@ -136,7 +134,7 @@ public boolean hasMoreEvents() { MetadataDescriptor previous = null; List types = new ArrayList<>(); HashSet foundIds = new HashSet<>(); - try (RecordingInput ri = new RecordingInput(file, FileAccess.UNPRIVILIGED)) { + try (RecordingInput ri = new RecordingInput(file, FileAccess.UNPRIVILEGED)) { ChunkHeader ch = new ChunkHeader(ri); aggregateEventTypeForChunk(ch, null, types, foundIds); while (!ch.isLastChunk()) { @@ -152,7 +150,7 @@ public boolean hasMoreEvents() { MetadataDescriptor previous = null; List types = new ArrayList<>(); HashSet foundIds = new HashSet<>(); - try (RecordingInput ri = new RecordingInput(file, FileAccess.UNPRIVILIGED)) { + try (RecordingInput ri = new RecordingInput(file, FileAccess.UNPRIVILEGED)) { ChunkHeader ch = new ChunkHeader(ri); ch.awaitFinished(); aggregateTypeForChunk(ch, null, types, foundIds); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java index c8c82befd54..c5c749c3026 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java @@ -51,18 +51,15 @@ * The following example shows how to record events using the default * configuration and print the Garbage Collection, CPU Load and JVM Information * event to standard out. - *
      - * 
      + * 
      {@literal
        * Configuration c = Configuration.getConfiguration("default");
        * try (var rs = new RecordingStream(c)) {
        *     rs.onEvent("jdk.GarbageCollection", System.out::println);
        *     rs.onEvent("jdk.CPULoad", System.out::println);
        *     rs.onEvent("jdk.JVMInformation", System.out::println);
        *     rs.start();
      - *   }
        * }
      - * 
      - * 
      + * }
      * * @since 14 */ @@ -88,7 +85,7 @@ public RecordingStream() { this.recording = new Recording(); try { PlatformRecording pr = PrivateAccess.getInstance().getPlatformRecording(recording); - this.directoryStream = new EventDirectoryStream(acc, null, SecuritySupport.PRIVILIGED, pr); + this.directoryStream = new EventDirectoryStream(acc, null, SecuritySupport.PRIVILEGED, pr); } catch (IOException ioe) { this.recording.close(); throw new IllegalStateException(ioe.getMessage()); @@ -101,15 +98,13 @@ public RecordingStream() { * The following example shows how to create a recording stream that uses a * predefined configuration. * - *
      -     * 
      +     * 
      {@literal
            * var c = Configuration.getConfiguration("default");
            * try (var rs = new RecordingStream(c)) {
            *   rs.onEvent(System.out::println);
            *   rs.start();
            * }
      -     * 
      -     * 
      + * }
      * * @param configuration configuration that contains the settings to use, * not {@code null} @@ -152,19 +147,17 @@ public EventSettings enable(String name) { * The following example records 20 seconds using the "default" configuration * and then changes settings to the "profile" configuration. * - *
      -     * 
      -     *     Configuration defaultConfiguration = Configuration.getConfiguration("default");
      -     *     Configuration profileConfiguration = Configuration.getConfiguration("profile");
      -     *     try (var rs = new RecordingStream(defaultConfiguration) {
      -     *        rs.onEvent(System.out::println);
      -     *        rs.startAsync();
      -     *        Thread.sleep(20_000);
      -     *        rs.setSettings(profileConfiguration.getSettings());
      -     *        Thread.sleep(20_000);
      -     *     }
      -     * 
      -     * 
      + *
      {@literal
      +     * Configuration defaultConfiguration = Configuration.getConfiguration("default");
      +     * Configuration profileConfiguration = Configuration.getConfiguration("profile");
      +     * try (var rs = new RecordingStream(defaultConfiguration)) {
      +     *    rs.onEvent(System.out::println);
      +     *    rs.startAsync();
      +     *    Thread.sleep(20_000);
      +     *    rs.setSettings(profileConfiguration.getSettings());
      +     *    Thread.sleep(20_000);
      +     * }
      +     * }
      * * @param settings the settings to set, not {@code null} * @@ -330,17 +323,16 @@ public void start() { } /** - * Start asynchronous processing of actions. + * Starts asynchronous processing of actions. *

      * Actions are performed in a single separate thread. *

      - * To stop the stream, use the {@code #close()} method. + * To stop the stream, use the {@link #close()} method. *

      * The following example prints the CPU usage for ten seconds. When * the current thread leaves the try-with-resources block the * stream is stopped/closed. - *

      -     * 
      +     * 
      {@literal
            * try (var stream = new RecordingStream()) {
            *   stream.enable("jdk.CPULoad").withPeriod(Duration.ofSeconds(1));
            *   stream.onEvent("jdk.CPULoad", event -> {
      @@ -349,11 +341,9 @@ public void start() {
            *   stream.startAsync();
            *   Thread.sleep(10_000);
            * }
      -     * 
      -     * 
      + * }
      * * @throws IllegalStateException if the stream is already started or closed - * */ @Override public void startAsync() { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java index ba9b1e4833f..2ebde0891ca 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,7 @@ * This package contains classes for consuming Flight Recorder data. *

      * In the following example, the program prints a histogram of all method samples in a recording. - *

      - * 
      + * 
      {@literal
        * public static void main(String[] args) throws IOException {
        *     if (args.length != 1) {
        *         System.err.println("Must specify a recording file.");
      @@ -50,8 +49,7 @@
        *         .sorted((a, b) -> b.getValue().compareTo(a.getValue()))
        *         .forEach(e -> System.out.printf("%8d %s\n", e.getValue(), e.getKey()));
        * }
      - * 
      - * 
      + * }
      *

      * Null-handling *

      diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java index 3b24aec0bbf..39a53dfb03f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -102,7 +102,7 @@ public String run() { return getValue(); } catch (Throwable t) { // Prevent malicious user to propagate exception callback in the wrong context - Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occured when trying to get value for " + getClass()); + Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when trying to get value for " + getClass()); } return defaultValue != null ? defaultValue : ""; // Need to return something } @@ -123,7 +123,7 @@ final void setValueSafe(String value) { try { setValue(value); } catch (Throwable t) { - Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occured when setting value \"" + value + "\" for " + getClass()); + Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when setting value \"" + value + "\" for " + getClass()); } } else { AccessController.doPrivileged(new PrivilegedAction() { @@ -133,7 +133,7 @@ public Void run() { setValue(value); } catch (Throwable t) { // Prevent malicious user to propagate exception callback in the wrong context - Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occured when setting value \"" + value + "\" for " + getClass()); + Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when setting value \"" + value + "\" for " + getClass()); } return null; } @@ -155,7 +155,7 @@ public String run() { combine(Collections.unmodifiableSet(values)); } catch (Throwable t) { // Prevent malicious user to propagate exception callback in the wrong context - Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occured when combining " + values + " for " + getClass()); + Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when combining " + values + " for " + getClass()); } return null; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Cutoff.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Cutoff.java index 5b3bcc7f164..37630b43fce 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Cutoff.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Cutoff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ * Event annotation, determines the cutoff above which an event should not be * recorded, i.e. {@code "20 ms"}. * - * This settings is only supported for JVM events, + * This settings is only supported for JVM events. * * @since 9 */ @@ -50,7 +50,7 @@ * Settings name {@code "cutoff"} for configuring event cutoffs. */ public final static String NAME = "cutoff"; - public final static String INIFITY = "infinity"; + public final static String INFINITY = "infinity"; /** * Cutoff, for example {@code "20 ms"}. @@ -67,9 +67,9 @@ * {@code "d"} (days)
      *

      * Example values, {@code "0 ns"}, {@code "10 ms"} and {@code "1 s"}. If the - * events has an infinite timespan, the text {@code"infinity"} should be used. + * events has an infinite timespan, the text {@code "infinity"} should be used. * * @return the threshold, default {@code "0 ns"} not {@code null} */ - String value() default "inifity"; + String value() default "infinity"; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java index fa2e5bdae69..70effc2f01d 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -244,7 +244,7 @@ private static Control defineStackTrace(PlatformEventType type) { private static Control defineCutoff(PlatformEventType type) { Cutoff cutoff = type.getAnnotation(Cutoff.class); - String def = Cutoff.INIFITY; + String def = Cutoff.INFINITY; if (cutoff != null) { def = cutoff.value(); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java index 9b0d6f77678..4d6cfd41cbc 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,7 +56,7 @@ // with for example WLS. private static final int CLASS_VERSION = 52; - // This is needed so a new EventHandler is automatically generated in MetadataRespoistory + // This is needed so a new EventHandler is automatically generated in MetadataRepository // if a user Event class is loaded using APPCDS/CDS. private static final String SUFFIX = "_" + System.currentTimeMillis() + "-" + JVM.getJVM().getPid(); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java index 758e5abe34c..961590cfa64 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -320,7 +320,7 @@ public static boolean isValidField(int access, String className) { return result; } - public byte[] builUninstrumented() { + public byte[] buildUninstrumented() { makeUninstrumented(); return toByteArray(); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java index c3f19358301..307346fbdc0 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java @@ -25,7 +25,6 @@ package jdk.jfr.internal; -import java.io.IOException; import java.util.List; import jdk.internal.HotSpotIntrinsicCandidate; @@ -283,7 +282,6 @@ private JVM() { * * @param file the file where data should be written, or null if it should * not be copied out (in memory). - * @throws IOException */ public native void setOutput(String file); @@ -362,8 +360,6 @@ private JVM() { * Requires that JFR has been started with {@link #createNativeJFR()} * * @param bytes binary representation of metadata descriptor - * - * @param binary representation of descriptor */ public native void storeMetadataDescriptor(byte[] bytes); @@ -428,8 +424,8 @@ public boolean hasNativeJFR() { public native double getTimeConversionFactor(); /** - * Return a unique identifier for a class. Compared to {@link #getClassId()} - * , this method does not tag the class as being "in-use". + * Return a unique identifier for a class. Compared to {@link #getClassId(Class)}, + * this method does not tag the class as being "in-use". * * @param clazz class * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java index 9e8ce2e4de6..2e4e4c95a3f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ * Id of the class * @param forceInstrumentation * add instrumentation regardless if event is enabled or not. - * @param superClazz + * @param superClass * the super class of the class being processed * @param oldBytes * byte code diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java index 831b4444c6d..833be1317a6 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -328,7 +328,7 @@ private void addFields(Map lookup, Map } } if (t.cutoff) { - aes.add(new AnnotationElement(Cutoff.class, Cutoff.INIFITY)); + aes.add(new AnnotationElement(Cutoff.class, Cutoff.INFINITY)); } } if (t.experimental) { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java index 4dd7545614d..5acefa6ec1f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ public final class MetadataRepository { private static final JVM jvm = JVM.getJVM(); - private static final MetadataRepository instace = new MetadataRepository(); + private static final MetadataRepository instance = new MetadataRepository(); private final List nativeEventTypes = new ArrayList<>(100); private final List nativeControls = new ArrayList(100); @@ -93,7 +93,7 @@ private void initializeJVMEventTypes() { } public static MetadataRepository getInstance() { - return instace; + return instance; } public synchronized List getRegisteredEventTypes() { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java index de1300b8b54..ba223c0e73a 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformEventType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,7 @@ private boolean isInstrumented; private boolean markForInstrumentation; private boolean registered = true; - private boolean commitable = enabled && registered; + private boolean committable = enabled && registered; // package private @@ -161,7 +161,7 @@ public boolean isJDK() { public void setEnabled(boolean enabled) { this.enabled = enabled; - updateCommitable(); + updateCommittable(); if (isJVM) { if (isMethodSampling) { long p = enabled ? period : 0; @@ -247,7 +247,7 @@ public boolean isMarkedForInstrumentation() { public boolean setRegistered(boolean registered) { if (this.registered != registered) { this.registered = registered; - updateCommitable(); + updateCommittable(); LogTag logTag = isJVM() || isJDK() ? LogTag.JFR_SYSTEM_EVENT : LogTag.JFR_EVENT; if (registered) { Logger.log(logTag, LogLevel.INFO, "Registered " + getLogName()); @@ -262,8 +262,8 @@ public boolean setRegistered(boolean registered) { return false; } - private void updateCommitable() { - this.commitable = enabled && registered; + private void updateCommittable() { + this.committable = enabled && registered; } public final boolean isRegistered() { @@ -271,8 +271,8 @@ public final boolean isRegistered() { } // Efficient check of enabled && registered - public boolean isCommitable() { - return commitable; + public boolean isCommittable() { + return committable; } public int getStackTraceOffset() { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java index ad23f040601..2ddd96e00ce 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java @@ -243,7 +243,7 @@ synchronized long start(PlatformRecording recording) { RepositoryChunk newChunk = null; if (toDisk) { newChunk = repository.newChunk(now); - MetadataRepository.getInstance().setOutput(newChunk.getUnfishedFile().toString()); + MetadataRepository.getInstance().setOutput(newChunk.getUnfinishedFile().toString()); } else { MetadataRepository.getInstance().setOutput(null); } @@ -258,7 +258,7 @@ synchronized long start(PlatformRecording recording) { if (toDisk) { newChunk = repository.newChunk(now); RequestEngine.doChunkEnd(); - MetadataRepository.getInstance().setOutput(newChunk.getUnfishedFile().toString()); + MetadataRepository.getInstance().setOutput(newChunk.getUnfinishedFile().toString()); startNanos = jvm.getChunkStartNanos(); } recording.setState(RecordingState.RUNNING); @@ -326,7 +326,7 @@ synchronized void stop(PlatformRecording recording) { updateSettingsButIgnoreRecording(recording); if (toDisk) { newChunk = repository.newChunk(now); - MetadataRepository.getInstance().setOutput(newChunk.getUnfishedFile().toString()); + MetadataRepository.getInstance().setOutput(newChunk.getUnfinishedFile().toString()); } else { MetadataRepository.getInstance().setOutput(null); } @@ -378,7 +378,7 @@ synchronized void rotateDisk() { Instant now = Instant.now(); RepositoryChunk newChunk = repository.newChunk(now); RequestEngine.doChunkEnd(); - MetadataRepository.getInstance().setOutput(newChunk.getUnfishedFile().toString()); + MetadataRepository.getInstance().setOutput(newChunk.getUnfinishedFile().toString()); writeMetaEvents(); if (currentChunk != null) { finishChunk(currentChunk, now, null); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java index a77a5902936..5d7c927afbe 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java @@ -83,14 +83,14 @@ private TimerTask stopTask; private TimerTask startTask; private AccessControlContext noDestinationDumpOnExitAccessControlContext; - private boolean shuoldWriteActiveRecordingEvent = true; + private boolean shouldWriteActiveRecordingEvent = true; private Duration flushInterval = Duration.ofSeconds(1); private long finalStartChunkNanos = Long.MIN_VALUE; PlatformRecording(PlatformRecorder recorder, long id) { // Typically the access control context is taken - // when you call dump(Path) or setDdestination(Path), - // but if no destination is set and dumponexit=true + // when you call dump(Path) or setDestination(Path), + // but if no destination is set and dumpOnExit=true // the control context of the recording is taken when the // Recording object is constructed. This works well for // -XX:StartFlightRecording and JFR.dump @@ -203,7 +203,7 @@ public void scheduleStart(Duration delay) { private void ensureOkForSchedule() { if (getState() != RecordingState.NEW) { - throw new IllegalStateException("Only a new recoridng can be scheduled for start"); + throw new IllegalStateException("Only a new recording can be scheduled for start"); } } @@ -682,11 +682,11 @@ public AccessControlContext getNoDestinationDumpOnExitAccessControlContext() { } void setShouldWriteActiveRecordingEvent(boolean shouldWrite) { - this.shuoldWriteActiveRecordingEvent = shouldWrite; + this.shouldWriteActiveRecordingEvent = shouldWrite; } boolean shouldWriteMetadataEvent() { - return shuoldWriteActiveRecordingEvent; + return shouldWriteActiveRecordingEvent; } // Dump running and stopped recordings @@ -700,7 +700,7 @@ public void dump(WriteableUserPath writeableUserPath) throws IOException { public void dumpStopped(WriteableUserPath userPath) throws IOException { synchronized (recorder) { - userPath.doPriviligedIO(() -> { + userPath.doPrivilegedIO(() -> { try (ChunksChannel cc = new ChunksChannel(chunks); FileChannel fc = FileChannel.open(userPath.getReal(), StandardOpenOption.WRITE, StandardOpenOption.APPEND)) { cc.transferTo(fc); fc.force(true); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java index b79a384eea1..75d931fb1d4 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,10 +51,10 @@ public static PrivateAccess getInstance() { // Can't be initialized in because it may - // deadlock with FlightRecordeerPermission. + // deadlock with FlightRecorderPermission. if (instance == null) { // Will trigger - // FlightRecordeerPermission. + // FlightRecorderPermission. // which will call PrivateAccess.setPrivateAccess new FlightRecorderPermission(Utils.REGISTER_EVENT); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java index f5180051923..33f66f9bc66 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/RepositoryChunk.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,7 +83,7 @@ private static SafePath findFileName(SafePath directory, String name, String ext return SecuritySupport.toRealPath(new SafePath(p)); } - public SafePath getUnfishedFile() { + public SafePath getUnfinishedFile() { return unFinishedFile; } @@ -91,7 +91,7 @@ void finish(Instant endTime) { try { finishWithException(endTime); } catch (IOException e) { - Logger.log(LogTag.JFR, LogLevel.ERROR, "Could not finish chunk. " + e.getMessage()); + Logger.log(LogTag.JFR, LogLevel.ERROR, "Could not finish chunk. " + e.getClass() + " "+ e.getMessage()); } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java index 6a28fb3cd1a..b76aa44484a 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,7 +74,7 @@ private void execute() { } } catch (Throwable e) { // Prevent malicious user to propagate exception callback in the wrong context - Logger.log(LogTag.JFR_SYSTEM_EVENT, LogLevel.WARN, "Exception occured during execution of period hook for " + type.getLogName()); + Logger.log(LogTag.JFR_SYSTEM_EVENT, LogLevel.WARN, "Exception occurred during execution of period hook for " + type.getLogName()); } } @@ -87,7 +87,7 @@ public Void run() { Logger.log(LogTag.JFR_EVENT, LogLevel.DEBUG, ()-> "Executed periodic hook for " + type.getLogName()); } catch (Throwable t) { // Prevent malicious user to propagate exception callback in the wrong context - Logger.log(LogTag.JFR_EVENT, LogLevel.WARN, "Exception occured during execution of period hook for " + type.getLogName()); + Logger.log(LogTag.JFR_EVENT, LogLevel.WARN, "Exception occurred during execution of period hook for " + type.getLogName()); } return null; } @@ -238,7 +238,7 @@ private static long run_requests(Collection entries) { // calculate time left left = (r_period - r_delta); - /** + /* * nothing outside checks that a period is >= 0, so left can end up * negative here. ex. (r_period =(-1)) - (r_delta = 0) if it is, * handle it. diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java index 6de545977b4..f9b2c0d1631 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/SecuritySupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ private final static MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); private final static Module JFR_MODULE = Event.class.getModule(); public final static SafePath JFC_DIRECTORY = getPathInProperty("java.home", "lib/jfr"); - public final static FileAccess PRIVILIGED = new Privileged(); + public final static FileAccess PRIVILEGED = new Privileged(); static final SafePath USER_HOME = getPathInProperty("user.home", null); static final SafePath JAVA_IO_TMPDIR = getPathInProperty("java.io.tmpdir", null); @@ -453,8 +453,8 @@ public static Thread createThreadWitNoPermissions(String threadName, Runnable ru return doPrivilegedWithReturn(() -> new Thread(runnable, threadName), new Permission[0]); } - static void setDaemonThread(Thread t, boolean daeomn) { - doPrivileged(()-> t.setDaemon(daeomn), new RuntimePermission("modifyThread")); + static void setDaemonThread(Thread t, boolean daemon) { + doPrivileged(()-> t.setDaemon(daemon), new RuntimePermission("modifyThread")); } public static SafePath getAbsolutePath(SafePath path) throws IOException { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java index fafd4e7ce09..97f2a1d6650 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Type.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,24 +82,24 @@ * * @param javaTypeName i.e "java.lang.String" * @param superType i.e "java.lang.Annotation" - * @param id the class id that represents the class in the JVM + * @param typeId the class id that represents the class in the JVM * */ public Type(String javaTypeName, String superType, long typeId) { this(javaTypeName, superType, typeId, false); } - Type(String javaTypeName, String superType, long typeId, boolean contantPool) { - this(javaTypeName, superType, typeId, contantPool, null); + Type(String javaTypeName, String superType, long typeId, boolean constantPool) { + this(javaTypeName, superType, typeId, constantPool, null); } - Type(String javaTypeName, String superType, long typeId, boolean contantPool, Boolean simpleType) { + Type(String javaTypeName, String superType, long typeId, boolean constantPool, Boolean simpleType) { Objects.requireNonNull(javaTypeName); if (!isValidJavaIdentifier(javaTypeName)) { throw new IllegalArgumentException(javaTypeName + " is not a valid Java identifier"); } - this.constantPool = contantPool; + this.constantPool = constantPool; this.superType = superType; this.name = javaTypeName; this.id = typeId; diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java index 90d4ac95839..1e653e622c5 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/TypeLibrary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -165,7 +165,7 @@ private static Object invokeAnnotation(Annotation annotation, String methodName) try { m = annotation.getClass().getMethod(methodName, new Class[0]); } catch (NoSuchMethodException e1) { - throw (Error) new InternalError("Could not loacate method " + methodName + " in annotation " + annotation.getClass().getName()); + throw (Error) new InternalError("Could not locate method " + methodName + " in annotation " + annotation.getClass().getName()); } SecuritySupport.setAccessible(m); try { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java index 70271e16af4..3b56f64612c 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java @@ -213,7 +213,7 @@ public static long parseTimespan(String s) { try { Long.parseLong(s); } catch (NumberFormatException nfe) { - throw new NumberFormatException("'" + s + "' is not a valid timespan. Shoule be numeric value followed by a unit, i.e. 20 ms. Valid units are ns, us, s, m, h and d."); + throw new NumberFormatException("'" + s + "' is not a valid timespan. Should be numeric value followed by a unit, i.e. 20 ms. Valid units are ns, us, s, m, h and d."); } // Only accept values with units throw new NumberFormatException("Timespan + '" + s + "' is missing unit. Valid units are ns, us, s, m, h and d."); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java index d802b3b8c37..4024c9eb364 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/WriteableUserPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ * A user supplied path must never be used in an unsafe context, such as a * shutdown hook or any other thread created by JFR. *

      - * All operation using this path must happen in {@link #doPriviligedIO(Callable)} + * All operation using this path must happen in {@link #doPrivilegedIO(Callable)} */ public final class WriteableUserPath { private final AccessControlContext controlContext; @@ -120,7 +120,7 @@ public Path getReal() { return real; } - public void doPriviligedIO(Callable function) throws IOException { + public void doPrivilegedIO(Callable function) throws IOException { try { inPrivileged = true; AccessController.doPrivileged(new PrivilegedExceptionAction() { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ChunkParser.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ChunkParser.java index 4d5b90ec48c..8e3a52b7cab 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ChunkParser.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ChunkParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -187,8 +187,6 @@ void updateConfiguration(ParserConfiguration configuration, boolean resetEventCa /** * Reads an event and returns null when segment or chunk ends. - * - * @param awaitNewEvents wait for new data. */ RecordedEvent readStreamingEvent() throws IOException { long absoluteChunkEnd = chunkHeader.getEnd(); @@ -198,7 +196,7 @@ RecordedEvent readStreamingEvent() throws IOException { } long lastValid = absoluteChunkEnd; long metadataPosition = chunkHeader.getMetataPosition(); - long contantPosition = chunkHeader.getConstantPoolPosition(); + long constantPosition = chunkHeader.getConstantPoolPosition(); chunkFinished = awaitUpdatedHeader(absoluteChunkEnd, configuration.filterEnd); if (chunkFinished) { Logger.log(LogTag.JFR_SYSTEM_PARSER, LogLevel.INFO, "At chunk end"); @@ -214,10 +212,10 @@ RecordedEvent readStreamingEvent() throws IOException { typeMap = factory.getTypeMap(); updateConfiguration(); } - if (contantPosition != chunkHeader.getConstantPoolPosition()) { + if (constantPosition != chunkHeader.getConstantPoolPosition()) { Logger.log(LogTag.JFR_SYSTEM_PARSER, LogLevel.INFO, "Found new constant pool data. Filling up pools with new values"); constantLookups.forEach(c -> c.getLatestPool().setAllResolved(false)); - fillConstantPools(contantPosition + chunkHeader.getAbsoluteChunkStart()); + fillConstantPools(constantPosition + chunkHeader.getAbsoluteChunkStart()); constantLookups.forEach(c -> c.getLatestPool().setResolving()); constantLookups.forEach(c -> c.getLatestPool().resolve()); constantLookups.forEach(c -> c.getLatestPool().setResolved()); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ConstantMap.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ConstantMap.java index cd5415f44d7..72b68092818 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ConstantMap.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ConstantMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ /** * Holds mapping between a set of keys and their corresponding object. * - * If the type is a known type, i.e. {@link RecordedThread}, an + * If the type is a known type, i.e. {@link jdk.jfr.consumer.RecordedThread}, an * {@link ObjectFactory} can be supplied which will instantiate a typed object. */ final class ConstantMap { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/EventFileStream.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/EventFileStream.java index a71282d05b7..8df7e5cfa25 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/EventFileStream.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/EventFileStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,9 +33,6 @@ import java.util.Objects; import jdk.jfr.consumer.RecordedEvent; -import jdk.jfr.internal.consumer.Dispatcher; -import jdk.jfr.internal.consumer.FileAccess; -import jdk.jfr.internal.consumer.RecordingInput; /** * Implementation of an event stream that operates against a recording file. @@ -52,7 +49,7 @@ public EventFileStream(AccessControlContext acc, Path path) throws IOException { super(acc, null); Objects.requireNonNull(path); - this.input = new RecordingInput(path.toFile(), FileAccess.UNPRIVILIGED); + this.input = new RecordingInput(path.toFile(), FileAccess.UNPRIVILEGED); } @Override diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/EventParser.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/EventParser.java index 4d6661c30fa..5c75f78a28b 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/EventParser.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/EventParser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -157,7 +157,7 @@ public RecordedEvent parse(RecordingInput input) throws IOException { @Override public void skip(RecordingInput input) throws IOException { - throw new InternalError("Should not call this method. More efficent to read event size and skip ahead"); + throw new InternalError("Should not call this method. More efficient to read event size and skip ahead"); } public void resetCache() { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/FileAccess.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/FileAccess.java index ccbd8835969..92572548260 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/FileAccess.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/FileAccess.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,7 +34,7 @@ // Protected by modular boundaries. public abstract class FileAccess { - public final static FileAccess UNPRIVILIGED = new UnPriviliged(); + public final static FileAccess UNPRIVILEGED = new UnPrivileged(); public abstract RandomAccessFile openRAF(File f, String mode) throws IOException; @@ -46,7 +46,7 @@ public abstract long fileSize(Path p) throws IOException; - private static class UnPriviliged extends FileAccess { + private static class UnPrivileged extends FileAccess { @Override public RandomAccessFile openRAF(File f, String mode) throws IOException { return new RandomAccessFile(f, mode); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/JdkJfrConsumer.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/JdkJfrConsumer.java index 64f7885e10a..edd2d755a5d 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/JdkJfrConsumer.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/JdkJfrConsumer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ private static JdkJfrConsumer instance; // Initialization will trigger setAccess being called - private static void forceInitializetion() { + private static void forceInitialization() { try { Class c = RecordedObject.class; Class.forName(c.getName(), true, c.getClassLoader()); @@ -64,7 +64,7 @@ public static void setAccess(JdkJfrConsumer access) { public static JdkJfrConsumer instance() { if (instance == null) { - forceInitializetion(); + forceInitialization(); } return instance; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/Parser.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/Parser.java index 54edc910bfd..49cbc13bdcb 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/Parser.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/Parser.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,7 +42,7 @@ public abstract Object parse(RecordingInput input) throws IOException; /** - * Skips data that would usually be by parsed the {@code #parse(RecordingInput)} method. + * Skips data that would usually be by parsed the {@link #parse(RecordingInput)} method. * * @param input input to read from * @throws IOException if operation couldn't be completed due to I/O diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/TimeConverter.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/TimeConverter.java index 44f962c5b88..356c2eb78a0 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/TimeConverter.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/TimeConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ import jdk.jfr.internal.LogLevel; import jdk.jfr.internal.LogTag; import jdk.jfr.internal.Logger; -import jdk.jfr.internal.consumer.ChunkHeader; /** * Converts ticks to nanoseconds @@ -40,13 +39,13 @@ private final long startTicks; private final long startNanos; private final double divisor; - private final ZoneOffset zoneOffet; + private final ZoneOffset zoneOffset; TimeConverter(ChunkHeader chunkHeader, int rawOffset) { this.startTicks = chunkHeader.getStartTicks(); this.startNanos = chunkHeader.getStartNanos(); this.divisor = chunkHeader.getTicksPerSecond() / 1000_000_000L; - this.zoneOffet = zoneOfSet(rawOffset); + this.zoneOffset = zoneOfSet(rawOffset); } public long convertTimestamp(long ticks) { @@ -58,7 +57,7 @@ public long convertTimespan(long ticks) { } public ZoneOffset getZoneOffset() { - return zoneOffet; + return zoneOffset; } private ZoneOffset zoneOfSet(int rawOffset) { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java index 030a97a1bea..466a0babd62 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,7 +70,7 @@ public String getPid() { // Invoking ProcessHandle.current().pid() would require loading more // classes during startup so instead JVM.getJVM().getPid() is used. // The pid will not be exposed to running Java application, only when starting - // JFR from command line (-XX:StartFlightRecordin) or jcmd (JFR.start and JFR.check) + // JFR from command line (-XX:StartFlightRecording) or jcmd (JFR.start and JFR.check) return JVM.getJVM().getPid(); } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java index 0cffba6a67b..70b11250c93 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ * Execute JFR.check * * @param recordingText name or id of the recording to check, or - * null to show a list of all recordings. + * {@code null} to show a list of all recordings. * * @param verbose if event settings should be included. * @@ -102,7 +102,7 @@ private void printRecording(Recording recording, boolean verbose) { printGeneral(recording); if (verbose) { println(); - printSetttings(recording); + printSettings(recording); } } @@ -130,7 +130,7 @@ private void printGeneral(Recording recording) { println(); } - private void printSetttings(Recording recording) { + private void printSettings(Recording recording) { Map settings = recording.getSettings(); for (EventType eventType : sortByEventPath(getFlightRecorder().getEventTypes())) { StringJoiner sj = new StringJoiner(",", "[", "]"); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java index 24f926153c2..edc4d1b678c 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ /** * Execute JFR.dump. * - * @param name name or id of the recording to dump, or null to dump everything + * @param name name or id of the recording to dump, or {@code null} to dump everything * * @param filename file path where recording should be written, not null * @param maxAge how far back in time to dump, may be null @@ -114,7 +114,7 @@ public String execute(String name, String filename, Long maxAge, Long maxSize, S if (beginTime != null && endTime != null) { if (endTime.isBefore(beginTime)) { - throw new DCmdException("Dump failed, begin must preceed end."); + throw new DCmdException("Dump failed, begin must precede end."); } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java index b858bfb6a8c..7d05bbe5fa9 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java @@ -69,10 +69,10 @@ * @param disk if recording should be persisted to disk * @param path file path where recording data should be written * @param maxAge how long recording data should be kept in the disk - * repository, or 0 if no limit should be set. + * repository, or {@code 0} if no limit should be set. * * @param maxSize the minimum amount data to keep in the disk repository - * before it is discarded, or 0 if no limit should be + * before it is discarded, or {@code 0} if no limit should be * set. * * @param dumpOnExit if recording should dump on exit diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java index 71490b1915a..90190829be6 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,12 +44,12 @@ /** * Execute JFR.stop * - * Requires that either name or id is set. + * Requires that either {@code name} or {@code id} is set. * * @param name name or id of the recording to stop. * * @param filename file path where data should be written after recording has - * been stopped, or null if recording shouldn't be written + * been stopped, or {@code null} if recording shouldn't be written * to disk. * @return result text * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java index 79b72757d51..00ecd760967 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,7 +64,7 @@ public final boolean shouldCommit(long duration) { // Accessed by generated code in event class // Accessed by generated sub class public final boolean isEnabled() { - return platformEventType.isCommitable(); + return platformEventType.isCommittable(); } public final EventType getEventType() { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java index 83cb63097cb..86245db7e08 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,7 +109,7 @@ private JFC() { * @throws IOException if the file can't be read * * @throws SecurityException if a security manager exists and its - * checkRead method denies read access to the file. + * {@code checkRead} method denies read access to the file * @see java.io.File#getPath() * @see java.lang.SecurityManager#checkRead(java.lang.String) */ diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd b/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd index ee47ba506eb..b09a5769c6f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd @@ -73,7 +73,7 @@ @@ -89,7 +89,7 @@ diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/management/ManagementSupport.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/management/ManagementSupport.java index efe4accdcd1..32a3f7a393a 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/management/ManagementSupport.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/management/ManagementSupport.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,7 @@ // This allows: // // 1) discoverability, so event settings can be exposed without the need to - // create a new Recording in FlightrecorderMXBean. + // create a new Recording in FlightRecorderMXBean. // // 2) a graphical JMX client to list all attributes to the user, without // loading JFR memory buffers. This is especially important when there is diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Disassemble.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Disassemble.java index 0ec55ba9267..f6fd0110592 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Disassemble.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Disassemble.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,7 +77,7 @@ public void displayOptionUsage(PrintStream stream) { @Override public String getDescription() { - return "Disassamble a recording file into smaller files/chunks"; + return "Disassemble a recording file into smaller files/chunks"; } @Override @@ -164,7 +164,7 @@ public void execute(Deque options) throws UserSyntaxException, UserDataE } private List findChunkSizes(Path p) throws IOException { - try (RecordingInput input = new RecordingInput(p.toFile(), FileAccess.UNPRIVILIGED)) { + try (RecordingInput input = new RecordingInput(p.toFile(), FileAccess.UNPRIVILEGED)) { List sizes = new ArrayList<>(); ChunkHeader ch = new ChunkHeader(input); sizes.add(ch.getSize()); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/EventPrintWriter.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/EventPrintWriter.java index 49b6e9bb776..3b9ed6b2efd 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/EventPrintWriter.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/EventPrintWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,7 +58,7 @@ private Predicate eventFilter = x -> true; private int stackDepth; - // cach that will speed up annotation lookup + // cache that will speed up annotation lookup private Map typeOfValues = new HashMap<>(); EventPrintWriter(PrintWriter p) { diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java index 45fb39f8562..0bff53af887 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/Summary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -92,7 +92,7 @@ private void printInformation(Path p) throws IOException { long totalDuration = 0; long chunks = 0; - try (RecordingInput input = new RecordingInput(p.toFile(), FileAccess.UNPRIVILIGED)) { + try (RecordingInput input = new RecordingInput(p.toFile(), FileAccess.UNPRIVILEGED)) { ChunkHeader first = new ChunkHeader(input); ChunkHeader ch = first; String eventPrefix = Type.EVENT_NAME_PREFIX; diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/UserSyntaxException.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/UserSyntaxException.java index db6224ccee3..0606bb37b58 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/UserSyntaxException.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/tool/UserSyntaxException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ * * @param errorMessage */ - public UserSyntaxException(String message) { - super(message); + public UserSyntaxException(String errorMessage) { + super(errorMessage); } } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/package-info.java b/src/jdk.jfr/share/classes/jdk/jfr/package-info.java index a33e6b041d0..50666d738ef 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/package-info.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,20 +35,20 @@ * To define a Flight Recorder event, extend {@link jdk.jfr.Event} and add * fields that matches the data types of the payload. Metadata about fields, * such as labels, descriptions and units, can be added by using the annotations - * available in the jdk.jfr package, or by using a user-defined + * available in the {@code jdk.jfr} package, or by using a user-defined * annotation that has the {@link jdk.jfr.MetadataDefinition} annotation. *

      * After an event class is defined, instances can be created (event objects). * Data is stored in the event by assigning data to fields. Event timing can be - * explicitly controlled by using the begin and {@code end} methods - * available in the Event class. + * explicitly controlled by using the {@code begin} and {@code end} methods + * available in the {@code Event} class. *

      * Gathering data to store in an event can be expensive. The - * {@link Event#shouldCommit()} method can be used to verify whether an event - * instance would actually be written to the system when the - * {@code Event#commit()} method is invoked. If - * {@link Event#shouldCommit()} returns {@code false}, then those operations can be - * avoided. + * {@link jdk.jfr.Event#shouldCommit()} method can be used to verify whether + * an event instance would actually be written to the system when + * the {@link jdk.jfr.Event#commit()} method is invoked. + * If {@link jdk.jfr.Event#shouldCommit()} returns {@code false}, + * then those operations can be avoided. *

      * Sometimes the field layout of an event is not known at compile time. In that * case, an event can be dynamically defined. However, dynamic events might not @@ -63,8 +63,8 @@ *

      * Controlling Flight Recorder *

      - * Flight Recorder can be controlled locally by using the jcmd - * command line tool or remotely by using the FlightRecorderMXBean + * Flight Recorder can be controlled locally by using the {@code jcmd} + * command line tool or remotely by using the {@code FlightRecorderMXBean} * interface, registered in the platform MBeanServer. When direct programmatic * access is needed, a Flight Recorder instance can be obtained by invoking * {@link jdk.jfr.FlightRecorder#getFlightRecorder()} and a recording created by @@ -168,7 +168,7 @@ * * * {@code stackTrace} - * Specifies whether the stack trace from the {@code Event#commit()} method + * Specifies whether the stack trace from the {@link Event#commit()} method * is recorded * {@code "true"} * String representation of a {@code Boolean} ({@code "true"} or diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java index 651ebfb9364..f755701c54b 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_de.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"Westeurop\u00e4ische Zeit", "WEZ", "Westeurop\u00e4ische Sommerzeit", "WESZ", "Westeurop\u00E4ische Zeit", "WEZ"}; + String WGT[] = new String[] {"Westgr\u00f6nl\u00e4ndische Zeit", "WGT", + "Westgr\u00f6nl\u00e4ndische Sommerzeit", "WGST", + "Westgr\u00F6nl\u00E4ndische Zeit", "WGT"}; String WIT[] = new String[] {"Westindonesische Zeit", "WIB", "Westindonesische Sommerzeit", "WIST", "Westindonesische Zeit", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"Westgr\u00f6nl\u00e4ndische Zeit", "WGT", - "Westgr\u00f6nl\u00e4ndische Sommerzeit", "WGST", - "Westgr\u00F6nl\u00E4ndische Zeit", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java index cae59965b92..dcef8740a14 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_es.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"Hora de Europa Occidental", "WET", "Hora de verano de Europa Occidental", "WEST", "Hora de Europa Occidental", "WET"}; + String WGT[] = new String[] {"Hora de Groenlandia Occidental", "WGT", + "Hora de verano de Groenlandia Occidental", "WGST", + "Hora de Groenlandia Occidental", "WGT"}; String WIT[] = new String[] {"Hora de Indonesia Occidental", "WIB", "Indonesia Hora de verano de Indonesia Occidental", "WIST", "Hora de Indonesia Occidental", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"Hora de Groenlandia Occidental", "WGT", - "Hora de verano de Groenlandia Occidental", "WGST", - "Hora de Groenlandia Occidental", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java index a7c1858e173..cc1da582ee0 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_fr.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"Heure d'Europe de l'Ouest", "WET", "Heure d'\u00e9t\u00e9 d'Europe de l'Ouest", "WEST", "Heure d'Europe de l'Ouest", "WET"} ; + String WGT[] = new String[] {"Heure du Groenland de l'Ouest", "WGT", + "Heure d'\u00e9t\u00e9 du Groenland de l'Ouest", "WGST", + "Heure du Groenland de l'Ouest", "WGT"}; String WIT[] = new String[] {"Heure de l'Indon\u00e9sie occidentale", "WIB", "Heure d'\u00e9t\u00e9 de l'Indon\u00e9sie occidentale", "WIST", "Heure de l'Indon\u00E9sie occidentale", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"Heure du Groenland de l'Ouest", "WGT", - "Heure d'\u00e9t\u00e9 du Groenland de l'Ouest", "WGST", - "Heure du Groenland de l'Ouest", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java index 61201ebe464..e3562a0cdba 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_it.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"Ora dell'Europa occidentale", "WET", "Ora estiva dell'Europa occidentale", "WEST", "Ora dell'Europa occidentale", "WET"}; + String WGT[] = new String[] {"Ora della Groenlandia occidentale", "WGT", + "Ora estiva della Groenlandia occidentale", "WGST", + "Ora della Groenlandia occidentale", "WGT"}; String WIT[] = new String[] {"Ora dell'Indonesia occidentale", "WIB", "Ora estiva dell'Indonesia occidentale", "WIST", "Ora dell'Indonesia occidentale", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"Ora della Groenlandia occidentale", "WGT", - "Ora estiva della Groenlandia occidentale", "WGST", - "Ora della Groenlandia occidentale", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java index 4e896da5cf3..e0a7349166f 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ja.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"\u897f\u30e8\u30fc\u30ed\u30c3\u30d1\u6642\u9593", "WET", "\u897f\u30e8\u30fc\u30ed\u30c3\u30d1\u590f\u6642\u9593", "WEST", "\u897F\u90E8\u30E8\u30FC\u30ED\u30C3\u30D1\u6642\u9593", "WET"}; + String WGT[] = new String[] {"\u897f\u30b0\u30ea\u30fc\u30f3\u30e9\u30f3\u30c9\u6642\u9593", "WGT", + "\u897f\u30b0\u30ea\u30fc\u30f3\u30e9\u30f3\u30c9\u590f\u6642\u9593", "WGST", + "\u897F\u90E8\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u6642\u9593", "WGT"}; String WIT[] = new String[] {"\u897f\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u6642\u9593", "WIB", "\u897f\u30a4\u30f3\u30c9\u30cd\u30b7\u30a2\u590f\u6642\u9593", "WIST", "\u897F\u90E8\u30A4\u30F3\u30C9\u30CD\u30B7\u30A2\u6642\u9593", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"\u897f\u30b0\u30ea\u30fc\u30f3\u30e9\u30f3\u30c9\u6642\u9593", "WGT", - "\u897f\u30b0\u30ea\u30fc\u30f3\u30e9\u30f3\u30c9\u590f\u6642\u9593", "WGST", - "\u897F\u90E8\u30B0\u30EA\u30FC\u30F3\u30E9\u30F3\u30C9\u6642\u9593", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java index 72903e7129b..b4cff53ff14 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_ko.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"\uc11c\uc720\ub7fd \uc2dc\uac04", "WET", "\uc11c\uc720\ub7fd \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WEST", "\uC11C\uBD80 \uC720\uB7FD \uD45C\uC900\uC2DC", "WET"}; + String WGT[] = new String[] {"\uc11c\ubd80 \uadf8\ub9b0\ub79c\ub4dc \uc2dc\uac04", "WGT", + "\uc11c\ubd80 \uadf8\ub9b0\ub79c\ub4dc \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WGST", + "\uC11C\uBD80 \uADF8\uB9B0\uB780\uB4DC \uD45C\uC900\uC2DC", "WGT"}; String WIT[] = new String[] {"\uc11c\uc778\ub3c4\ub124\uc2dc\uc544 \uc2dc\uac04", "WIB", "\uc11c\uc778\ub3c4\ub124\uc2dc\uc544 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WIST", "\uC11C\uBD80 \uC778\uB3C4\uB124\uC2DC\uC544 \uD45C\uC900\uC2DC", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"\uc11c\ubd80 \uadf8\ub9b0\ub79c\ub4dc \uc2dc\uac04", "WGT", - "\uc11c\ubd80 \uadf8\ub9b0\ub79c\ub4dc \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "WGST", - "\uC11C\uBD80 \uADF8\uB9B0\uB780\uB4DC \uD45C\uC900\uC2DC", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java index b30213573b5..5d4602ad8e8 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_pt_BR.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"Fuso hor\u00e1rio da Europa Ocidental", "WET", "Fuso hor\u00e1rio de ver\u00e3o da Europa Ocidental", "WEST", "Hor\u00E1rio da Europa Ocidental", "WET"}; + String WGT[] = new String[] {"Fuso hor\u00e1rio da Groenl\u00e2ndia Ocidental", "WGT", + "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Ocidental", "WGST", + "Hor\u00E1rio da Groenl\u00E2ndia Ocidental", "WGT"}; String WIT[] = new String[] {"Fuso hor\u00e1rio da Indon\u00e9sia Ocidental", "WIB", "Fuso hor\u00e1rio de ver\u00e3o da Indon\u00e9sia Ocidental", "WIST", "Hor\u00E1rio da Indon\u00E9sia Ocidental", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"Fuso hor\u00e1rio da Groenl\u00e2ndia Ocidental", "WGT", - "Fuso hor\u00e1rio de ver\u00e3o da Groenl\u00e2ndia Ocidental", "WGST", - "Hor\u00E1rio da Groenl\u00E2ndia Ocidental", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java index 13289f6aa3d..6ea2a27eb74 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_sv.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"V\u00e4steuropeisk tid", "WET", "V\u00e4steuropeisk sommartid", "WEST", "V\u00E4steuropeisk tid", "WET"}; + String WGT[] = new String[] {"V\u00e4stra Gr\u00f6nland, normaltid", "WGT", + "V\u00e4stra Gr\u00f6nland, sommartid", "WGST", + "V\u00E4stgr\u00F6nl\u00E4ndsk tid", "WGT"}; String WIT[] = new String[] {"V\u00e4stindonesisk tid", "WIB", "V\u00e4stindonesisk sommartid", "WIST", "V\u00E4stindonesisk tid", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"V\u00e4stra Gr\u00f6nland, normaltid", "WGT", - "V\u00e4stra Gr\u00f6nland, sommartid", "WGST", - "V\u00E4stgr\u00F6nl\u00E4ndsk tid", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java index e04c8e8067f..97049ac7581 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_CN.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"\u897f\u6b27\u65f6\u95f4", "WET", "\u897f\u6b27\u590f\u4ee4\u65f6", "WEST", "\u897F\u6B27\u65F6\u95F4", "WET"}; + String WGT[] = new String[] {"\u897f\u683c\u6797\u5170\u5c9b\u65f6\u95f4", "WGT", + "\u897f\u683c\u6797\u5170\u5c9b\u590f\u4ee4\u65f6", "WGST", + "\u897F\u683C\u6797\u5170\u5C9B\u65F6\u95F4", "WGT"}; String WIT[] = new String[] {"\u897f\u5370\u5ea6\u5c3c\u897f\u4e9a\u65f6\u95f4", "WIB", "\u897f\u5370\u5ea6\u5c3c\u897f\u4e9a\u590f\u4ee4\u65f6", "WIST", "\u897F\u5370\u5EA6\u5C3C\u897F\u4E9A\u65F6\u95F4", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"\u897f\u683c\u6797\u5170\u5c9b\u65f6\u95f4", "WGT", - "\u897f\u683c\u6797\u5170\u5c9b\u590f\u4ee4\u65f6", "WGST", - "\u897F\u683C\u6797\u5170\u5C9B\u65F6\u95F4", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -782,7 +784,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java index fcafa0cf30b..5cf036a0dcb 100644 --- a/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java +++ b/src/jdk.localedata/share/classes/sun/util/resources/ext/TimeZoneNames_zh_TW.java @@ -252,6 +252,9 @@ String WET[] = new String[] {"\u897f\u6b50\u6642\u9593", "WET", "\u897f\u6b50\u590f\u4ee4\u6642\u9593", "WEST", "\u897F\u6B50\u6642\u9593", "WET"}; + String WGT[] = new String[] {"\u897f\u683c\u6797\u862d\u5cf6\u6642\u9593", "WGT", + "\u897f\u683c\u6797\u862d\u5cf6\u590f\u4ee4\u6642\u9593", "WGST", + "\u897F\u683C\u9675\u862D\u6642\u9593", "WGT"}; String WIT[] = new String[] {"\u897f\u5370\u5c3c\u6642\u9593", "WIB", "\u897f\u5370\u5c3c\u590f\u4ee4\u6642\u9593", "WIST", "\u897F\u5370\u5C3C\u6642\u9593", "WIB"}; @@ -430,7 +433,7 @@ {"America/Cuiaba", AMT}, {"America/Curacao", AST}, {"America/Danmarkshavn", GMT}, - {"America/Dawson", PST}, + {"America/Dawson", MST}, {"America/Dawson_Creek", MST}, {"America/Detroit", EST}, {"America/Dominica", AST}, @@ -442,9 +445,7 @@ {"America/Fort_Wayne", EST}, {"America/Fortaleza", BRT}, {"America/Glace_Bay", AST}, - {"America/Godthab", new String[] {"\u897f\u683c\u6797\u862d\u5cf6\u6642\u9593", "WGT", - "\u897f\u683c\u6797\u862d\u5cf6\u590f\u4ee4\u6642\u9593", "WGST", - "\u897F\u683C\u9675\u862D\u6642\u9593", "WGT"}}, + {"America/Godthab", WGT}, {"America/Goose_Bay", AST}, {"America/Grand_Turk", EST}, {"America/Grenada", AST}, @@ -512,6 +513,7 @@ {"America/North_Dakota/Beulah", CST}, {"America/North_Dakota/Center", CST}, {"America/North_Dakota/New_Salem", CST}, + {"America/Nuuk", WGT}, {"America/Ojinaga", MST}, {"America/Panama", EST}, {"America/Pangnirtung", EST}, @@ -551,7 +553,7 @@ {"America/Tortola", AST}, {"America/Vancouver", PST}, {"America/Virgin", AST}, - {"America/Whitehorse", PST}, + {"America/Whitehorse", MST}, {"America/Winnipeg", CST}, {"America/Yakutat", AKST}, {"America/Yellowknife", MST}, @@ -784,7 +786,7 @@ {"Canada/Mountain", MST}, {"Canada/Newfoundland", NST}, {"Canada/Pacific", PST}, - {"Canada/Yukon", PST}, + {"Canada/Yukon", MST}, {"Canada/Saskatchewan", CST}, {"CAT", CAT}, {"CET", CET}, diff --git a/test/hotspot/gtest/jfr/test_threadCpuLoad.cpp b/test/hotspot/gtest/jfr/test_threadCpuLoad.cpp index 7a28002eef4..9600cb18732 100644 --- a/test/hotspot/gtest/jfr/test_threadCpuLoad.cpp +++ b/test/hotspot/gtest/jfr/test_threadCpuLoad.cpp @@ -148,6 +148,12 @@ TEST_VM_F(JfrTestThreadCPULoadSingle, SingleCpu) { EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, 400 * NANOSECS_PER_MILLISEC, 1)); EXPECT_FLOAT_EQ(0.25, event.user); EXPECT_FLOAT_EQ(0.25, event.system); + + MockOs::user_cpu_time += 50 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time += 50 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (400 + 400) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.125, event.user); + EXPECT_FLOAT_EQ(0.125, event.system); } TEST_VM_F(JfrTestThreadCPULoadSingle, MultipleCpus) { @@ -177,6 +183,43 @@ TEST_VM_F(JfrTestThreadCPULoadSingle, UserAboveMaximum) { EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (200 + 400) * NANOSECS_PER_MILLISEC, 1)); EXPECT_FLOAT_EQ(0.25, event.user); EXPECT_FLOAT_EQ(0, event.system); + + // Third call: make sure there are no leftovers + MockOs::user_cpu_time += 50 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time += 50 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (200 + 400 + 400) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.125, event.user); + EXPECT_FLOAT_EQ(0.125, event.system); +} + +TEST_VM_F(JfrTestThreadCPULoadSingle, UserAboveMaximumNonZeroBase) { + + // Setup a non zero base + // Previously there was a bug when cur_user_time would be reset to zero and test that uses zero base would fail to detect it + MockOs::user_cpu_time = 100 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time = 100 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, 400 * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.25, event.user); + EXPECT_FLOAT_EQ(0.25, event.system); + + // First call will not report above 100% + MockOs::user_cpu_time += 200 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time += 100 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (400 + 200) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.5, event.user); + EXPECT_FLOAT_EQ(0.5, event.system); + + // Second call will see an extra 100 millisecs user time from the remainder + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (400 + 200 + 400) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.25, event.user); + EXPECT_FLOAT_EQ(0, event.system); + + // Third call: make sure there are no leftovers + MockOs::user_cpu_time += 50 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time += 50 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (400 + 200 + 400 + 400) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.125, event.user); + EXPECT_FLOAT_EQ(0.125, event.system); } TEST_VM_F(JfrTestThreadCPULoadSingle, SystemAboveMaximum) { @@ -192,6 +235,43 @@ TEST_VM_F(JfrTestThreadCPULoadSingle, SystemAboveMaximum) { EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (200 + 400) * NANOSECS_PER_MILLISEC, 1)); EXPECT_FLOAT_EQ(0.25, event.user); EXPECT_FLOAT_EQ(0.25, event.system); + + // Third call: make sure there are no leftovers + MockOs::user_cpu_time += 50 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time += 50 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (200 + 400 + 400) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.125, event.user); + EXPECT_FLOAT_EQ(0.125, event.system); +} + +TEST_VM_F(JfrTestThreadCPULoadSingle, SystemAboveMaximumNonZeroBase) { + + // Setup a non zero base + // Previously there was a bug when cur_user_time would be reset to zero and test that uses zero base would fail to detect it + MockOs::user_cpu_time = 100 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time = 100 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, 400 * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.25, event.user); + EXPECT_FLOAT_EQ(0.25, event.system); + + // First call will not report above 100% + MockOs::user_cpu_time += 100 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time += 300 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (400 + 200) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0, event.user); + EXPECT_FLOAT_EQ(1, event.system); + + // Second call will see an extra 100 millisecs user and system time from the remainder + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (400 + 200 + 400) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.25, event.user); + EXPECT_FLOAT_EQ(0.25, event.system); + + // Third call: make sure there are no leftovers + MockOs::user_cpu_time += 50 * NANOSECS_PER_MILLISEC; + MockOs::system_cpu_time += 50 * NANOSECS_PER_MILLISEC; + EXPECT_TRUE(JfrThreadCPULoadEvent::update_event(event, thread, (400 + 200 + 400 + 400) * NANOSECS_PER_MILLISEC, 1)); + EXPECT_FLOAT_EQ(0.125, event.user); + EXPECT_FLOAT_EQ(0.125, event.system); } TEST_VM_F(JfrTestThreadCPULoadSingle, SystemTimeDecreasing) { diff --git a/test/hotspot/gtest/memory/test_virtualspace.cpp b/test/hotspot/gtest/memory/test_virtualspace.cpp index 9dc2a62d21b..4557ba1c1c5 100644 --- a/test/hotspot/gtest/memory/test_virtualspace.cpp +++ b/test/hotspot/gtest/memory/test_virtualspace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,7 +104,7 @@ namespace { bool large = maybe_large && UseLargePages && size >= os::large_page_size(); - ReservedSpace rs(size, alignment, large, false); + ReservedSpace rs(size, alignment, large); MemoryReleaser releaser(&rs); EXPECT_TRUE(rs.base() != NULL) << "rs.special: " << rs.special(); @@ -218,7 +218,7 @@ namespace { case Commit: return ReservedSpace(reserve_size_aligned, os::vm_allocation_granularity(), - /* large */ false, /* exec */ false); + /* large */ false); } } @@ -297,7 +297,7 @@ TEST_VM(VirtualSpace, actual_committed_space_one_large_page) { size_t large_page_size = os::large_page_size(); - ReservedSpace reserved(large_page_size, large_page_size, true, false); + ReservedSpace reserved(large_page_size, large_page_size, true); ReservedSpaceReleaser releaser(&reserved); ASSERT_TRUE(reserved.is_reserved()); diff --git a/test/hotspot/jtreg/ProblemList-graal.txt b/test/hotspot/jtreg/ProblemList-graal.txt index ed057094673..27c2736aebb 100644 --- a/test/hotspot/jtreg/ProblemList-graal.txt +++ b/test/hotspot/jtreg/ProblemList-graal.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -242,5 +242,4 @@ org.graalvm.compiler.core.test.deopt.CompiledMethodTest 8202955 org.graalvm.compiler.hotspot.test.ReservedStackAccessTest 8213567 windows-all -org.graalvm.compiler.hotspot.test.CheckGraalIntrinsics 8219607 generic-all -org.graalvm.compiler.hotspot.test.LambdaStableNameTest 8219607 generic-all +org.graalvm.compiler.hotspot.test.LambdaStableNameTest 8243381 generic-all diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index ac90c0947cc..457bd05491f 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -95,7 +95,6 @@ gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 8241293 macosx-x64 runtime/jni/terminatedThread/TestTerminatedThread.java 8219652 aix-ppc64 runtime/ReservedStack/ReservedStackTest.java 8231031 generic-all -runtime/CompactStrings/TestMethodNames.java 8242921 generic-all ############################################################################# diff --git a/test/hotspot/jtreg/applications/ctw/modules/generate.bash b/test/hotspot/jtreg/applications/ctw/modules/generate.bash index 67cc281a302..08751a35226 100644 --- a/test/hotspot/jtreg/applications/ctw/modules/generate.bash +++ b/test/hotspot/jtreg/applications/ctw/modules/generate.bash @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ do echo creating $file for $module... cat > $file < 0) @@ -540,6 +557,13 @@ static int test() { end = System.currentTimeMillis(); System.out.println("test_negc_n: " + (end - start)); + start = System.currentTimeMillis(); + for (int i=0; i 0) @@ -488,6 +505,13 @@ static int test() { end = System.currentTimeMillis(); System.out.println("test_negc_n: " + (end - start)); + start = System.currentTimeMillis(); + for (int i=0; i= 240MB pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", "-XX:ReservedCodeCacheSize=240m", - "-XX:+PrintCodeCache", "-version"); + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation", "-XX:ReservedCodeCacheSize=400m", - "-XX:+PrintCodeCache", "-version"); + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); // Always enabled if SegmentedCodeCache is set pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", "-XX:-TieredCompilation", "-XX:ReservedCodeCacheSize=239m", - "-XX:+PrintCodeCache", "-version"); + "-XX:+PrintCodeCache", + "-version"); verifySegmentedCodeCache(pb, true); // The profiled and non-profiled code heaps should not be available in // interpreter-only mode pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", "-Xint", - "-XX:+PrintCodeCache", "-version"); + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED, NON_PROFILED); // If we stop compilation at CompLevel_none or CompLevel_simple we // don't need a profiled code heap. pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", "-XX:TieredStopAtLevel=0", - "-XX:+PrintCodeCache", "-version"); + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED); pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", "-XX:TieredStopAtLevel=1", - "-XX:+PrintCodeCache", "-version"); + "-XX:+PrintCodeCache", + "-version"); verifyCodeHeapNotExists(pb, PROFILED); // Fails with too small non-nmethod code heap size - pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K"); + pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K", + "-version"); failsWith(pb, "Invalid NonNMethodCodeHeapSize"); // Fails if code heap sizes do not add up @@ -144,7 +152,8 @@ public static void main(String[] args) throws Exception { "-XX:ReservedCodeCacheSize=10M", "-XX:NonNMethodCodeHeapSize=5M", "-XX:ProfiledCodeHeapSize=5M", - "-XX:NonProfiledCodeHeapSize=5M"); + "-XX:NonProfiledCodeHeapSize=5M", + "-version"); failsWith(pb, "Invalid code heap sizes"); // Fails if not enough space for VM internal code @@ -153,7 +162,8 @@ public static void main(String[] args) throws Exception { long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace; pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache", "-XX:ReservedCodeCacheSize=" + minSize, - "-XX:InitialCodeCacheSize=100K"); + "-XX:InitialCodeCacheSize=100K", + "-version"); failsWith(pb, "Not enough space in non-nmethod code heap to run VM"); } } diff --git a/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java b/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java index e92af3cc28e..d9629377db2 100644 --- a/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java +++ b/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* * -XX:-SegmentedCodeCache diff --git a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java index 4cafa89fc63..63c5c82daaa 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ * java.management * jdk.internal.jvmstat/sun.jvmstat.monitor * - * @run main/timeout=240 compiler.codecache.cli.printcodecache.TestPrintCodeCacheOption + * @run driver/timeout=240 compiler.codecache.cli.printcodecache.TestPrintCodeCacheOption */ package compiler.codecache.cli.printcodecache; diff --git a/test/hotspot/jtreg/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java b/test/hotspot/jtreg/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java index 4728630f7a0..71663a18534 100644 --- a/test/hotspot/jtreg/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/dtrace/SegmentedCodeCacheDtraceTest.java @@ -32,7 +32,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * compiler.codecache.dtrace.SegmentedCodeCacheDtraceTest diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java index dca730a46ac..479cd42ed33 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:+SegmentedCodeCache diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java index 0bdd2f78676..ea07ee8ad27 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:-SegmentedCodeCache diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java index cf838dd14da..6baac9b58af 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* * -XX:-UseCodeCacheFlushing -XX:-MethodFlushing diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java index f56f2f70857..154bd79e9e9 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:CompileCommand=compileonly,null::* -XX:-UseLargePages diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java index a80298a2066..02b31642512 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:+SegmentedCodeCache diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java index 6e5ea32f577..b64d12c0f11 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:+SegmentedCodeCache diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java index 57518e61833..94853651611 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,null::* * -XX:+SegmentedCodeCache diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java index 50b56ef461f..310ef17dd3e 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing * -XX:+SegmentedCodeCache diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java index e3cc8734674..36669bfcf7e 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -XX:+UnlockDiagnosticVMOptions -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing * -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::* * -XX:+SegmentedCodeCache diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java index fd39beaaaf7..b3b2f639516 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededSeveralTimesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing * -XX:CompileCommand=compileonly,null::* -Djdk.test.lib.iterations=10 diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java index bf78a1c910c..aa59bfcac88 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing * -XX:CompileCommand=compileonly,null::* diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java index ee071d41843..7e24d3ca299 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * java.management * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing * -XX:CompileCommand=compileonly,null::* diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java index 60587960821..64ee9331845 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:-UseCodeCacheFlushing -XX:-MethodFlushing * -XX:CompileCommand=compileonly,null::* diff --git a/test/hotspot/jtreg/compiler/codecache/stress/OverloadCompileQueueTest.java b/test/hotspot/jtreg/compiler/codecache/stress/OverloadCompileQueueTest.java index f63f18e889c..cd7cb8878e5 100644 --- a/test/hotspot/jtreg/compiler/codecache/stress/OverloadCompileQueueTest.java +++ b/test/hotspot/jtreg/compiler/codecache/stress/OverloadCompileQueueTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method diff --git a/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java b/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java index 9e9b0151e7c..5650e55fd16 100644 --- a/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java +++ b/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox compiler.codecache.stress.Helper compiler.codecache.stress.TestCaseImpl * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method diff --git a/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java b/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java index fece8bba554..73b8f2fdc32 100644 --- a/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java +++ b/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox compiler.codecache.stress.Helper compiler.codecache.stress.TestCaseImpl * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method diff --git a/test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationAllTest.java b/test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationAllTest.java index 09b663f8187..04188699771 100644 --- a/test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationAllTest.java +++ b/test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationAllTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox compiler.codecache.stress.Helper compiler.codecache.stress.TestCaseImpl * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom diff --git a/test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationTest.java b/test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationTest.java index 0935ed5204b..e4d2a83bf0b 100644 --- a/test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationTest.java +++ b/test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox compiler.codecache.stress.Helper compiler.codecache.stress.TestCaseImpl * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:-DeoptimizeRandom diff --git a/test/hotspot/jtreg/compiler/codegen/TestOopCmp.java b/test/hotspot/jtreg/compiler/codegen/TestOopCmp.java index 2705d941230..9c9183f0cf5 100644 --- a/test/hotspot/jtreg/compiler/codegen/TestOopCmp.java +++ b/test/hotspot/jtreg/compiler/codegen/TestOopCmp.java @@ -31,7 +31,6 @@ * @library /test/lib / * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbatch -XX:-UseTLAB -Xmx4m -XX:+UseSerialGC -XX:HeapBaseMinAddress=0x700000000 * -XX:CompileCommand=compileonly,compiler.codegen.TestOopCmp::nullTest * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java b/test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java index d4228777ad7..02a87746fc2 100644 --- a/test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java +++ b/test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java @@ -31,7 +31,7 @@ * @modules java.base/jdk.internal.misc * java.management * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @run driver ClassFileInstaller sun.hotspot.WhiteBox * * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java b/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java index 0a3d46d7c26..d9cc62f1f5c 100644 --- a/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java +++ b/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java @@ -28,7 +28,7 @@ * @summary SIGBUS in com.sun.crypto.provider.CipherBlockChaining * @library /test/lib / * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @run driver ClassFileInstaller sun.hotspot.WhiteBox * * @run main/othervm -Xbatch * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/test/hotspot/jtreg/compiler/compilercontrol/InlineMatcherTest.java b/test/hotspot/jtreg/compiler/compilercontrol/InlineMatcherTest.java index b2c6507c1d8..4711a1bae77 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/InlineMatcherTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/InlineMatcherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * compiler.compilercontrol.InlineMatcherTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java b/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java index 11013a69da3..18801c3e7a2 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.compilercontrol.TestCompilerDirectivesCompatibilityBase diff --git a/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java b/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java index d8e246c429a..48f1a7acabd 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions * -XX:-PrintAssembly -XX:CompileCommand=option,*.helper,bool,PrintAssembly,false * -XX:+WhiteBoxAPI diff --git a/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java b/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java index 44bf2a7ecd8..2a231ac2bf7 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions * -XX:-PrintAssembly -XX:CompileCommand=print,*.* -XX:+WhiteBoxAPI * compiler.compilercontrol.TestCompilerDirectivesCompatibilityCommandOn diff --git a/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java b/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java index 81f1460313d..846dc2784e5 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions * -XX:+PrintAssembly -XX:+WhiteBoxAPI * compiler.compilercontrol.TestCompilerDirectivesCompatibilityFlag diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commandfile/CompileOnlyTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commandfile/CompileOnlyTest.java index f46299ffbbb..bd737f3a496 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commandfile/CompileOnlyTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commandfile/CompileOnlyTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commandfile.CompileOnlyTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commandfile/ExcludeTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commandfile/ExcludeTest.java index 70f9c48f9a0..e795cb35cda 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commandfile/ExcludeTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commandfile/ExcludeTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commandfile.ExcludeTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commandfile/LogTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commandfile/LogTest.java index d3e2fd5d9f6..d50791c0210 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commandfile/LogTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commandfile/LogTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commandfile.LogTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commandfile/PrintTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commandfile/PrintTest.java index 55d48a99d31..3a84dc45bad 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commandfile/PrintTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commandfile/PrintTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commandfile.PrintTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commands/CompileOnlyTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commands/CompileOnlyTest.java index fa5b8c1e4ac..1f464c45935 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commands/CompileOnlyTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commands/CompileOnlyTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commands.CompileOnlyTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commands/ExcludeTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commands/ExcludeTest.java index 48bee334078..71d0fa142c3 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commands/ExcludeTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commands/ExcludeTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commands.ExcludeTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commands/LogTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commands/LogTest.java index 01e478268c7..946f1f63fc5 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commands/LogTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commands/LogTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commands.LogTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/commands/PrintTest.java b/test/hotspot/jtreg/compiler/compilercontrol/commands/PrintTest.java index 379ea2e2748..ef809948f47 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/commands/PrintTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/commands/PrintTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.commands.PrintTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/directives/CompileOnlyTest.java b/test/hotspot/jtreg/compiler/compilercontrol/directives/CompileOnlyTest.java index a7932bed1b4..574f9b68730 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/directives/CompileOnlyTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/directives/CompileOnlyTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.directives.CompileOnlyTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/directives/ExcludeTest.java b/test/hotspot/jtreg/compiler/compilercontrol/directives/ExcludeTest.java index ffed4b869be..8dfe2292b06 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/directives/ExcludeTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/directives/ExcludeTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.directives.ExcludeTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/directives/LogTest.java b/test/hotspot/jtreg/compiler/compilercontrol/directives/LogTest.java index b9a2e3db7b9..8c54de2bd74 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/directives/LogTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/directives/LogTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.directives.LogTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/directives/PrintTest.java b/test/hotspot/jtreg/compiler/compilercontrol/directives/PrintTest.java index f67eae0cdee..6e96e4288db 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/directives/PrintTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/directives/PrintTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.directives.PrintTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddAndRemoveTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddAndRemoveTest.java index 475ed15a261..898fa82410c 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddAndRemoveTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddAndRemoveTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddAndRemoveTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java index 74c8f03f840..86767407280 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddCompileOnlyTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddExcludeTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddExcludeTest.java index f093c4456ba..c67ec8e2d98 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddExcludeTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddExcludeTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddExcludeTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddLogTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddLogTest.java index 1b34b400f9c..fc4d8d633c5 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddLogTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddLogTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddLogTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java index 852ba92b32e..87029a42109 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java @@ -32,7 +32,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.AddPrintAssemblyTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java index 668b86f9aa5..6a18953c745 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java index 9a413aba9c0..a20ed6a53e5 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.ClearDirectivesStackTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/PrintDirectivesTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/PrintDirectivesTest.java index 0bbccbc0f39..8c1ea162423 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/PrintDirectivesTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/PrintDirectivesTest.java @@ -32,7 +32,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.PrintDirectivesTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java index ea2f8e0b76e..9a67797aa4a 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java @@ -32,7 +32,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.jcmd.StressAddMultiThreadedTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/logcompilation/LogTest.java b/test/hotspot/jtreg/compiler/compilercontrol/logcompilation/LogTest.java index 97650e9fbf6..14646bd5d13 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/logcompilation/LogTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/logcompilation/LogTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver compiler.compilercontrol.logcompilation.LogTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/matcher/MethodMatcherTest.java b/test/hotspot/jtreg/compiler/compilercontrol/matcher/MethodMatcherTest.java index c67260cf329..1f623791753 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/matcher/MethodMatcherTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/matcher/MethodMatcherTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI compiler.compilercontrol.matcher.MethodMatcherTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/mixed/RandomCommandsTest.java b/test/hotspot/jtreg/compiler/compilercontrol/mixed/RandomCommandsTest.java index 06ef0b0ba49..f03158e6efe 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/mixed/RandomCommandsTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/mixed/RandomCommandsTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver/timeout=1200 compiler.compilercontrol.mixed.RandomCommandsTest */ diff --git a/test/hotspot/jtreg/compiler/compilercontrol/mixed/RandomValidCommandsTest.java b/test/hotspot/jtreg/compiler/compilercontrol/mixed/RandomValidCommandsTest.java index cdbbae945f8..576c451a3f5 100644 --- a/test/hotspot/jtreg/compiler/compilercontrol/mixed/RandomValidCommandsTest.java +++ b/test/hotspot/jtreg/compiler/compilercontrol/mixed/RandomValidCommandsTest.java @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run driver/timeout=600 compiler.compilercontrol.mixed.RandomValidCommandsTest */ diff --git a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java index ac17e567b09..b0f92a7cf94 100644 --- a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java +++ b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * @requires vm.cpu.features ~= ".*aes.*" & !vm.graal.enabled * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm/timeout=600 -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch diff --git a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java index 60b2d033219..5525259fd6d 100644 --- a/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java +++ b/test/hotspot/jtreg/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * @requires !(vm.cpu.features ~= ".*aes.*") * @requires vm.compiler1.enabled | !vm.graal.enabled * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -Xbatch * compiler.cpuflags.TestAESIntrinsicsOnUnsupportedConfig diff --git a/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java b/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java index 4ad0ff80c80..72416a20023 100644 --- a/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java +++ b/test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopy.java @@ -31,7 +31,6 @@ * @library /testlibrary /test/lib * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * * @run main/othervm/timeout=300 * -Xbootclasspath/a:. diff --git a/test/hotspot/jtreg/compiler/floatingpoint/TestPow2.java b/test/hotspot/jtreg/compiler/floatingpoint/TestPow2.java index 5cf0aeed751..80526aeea2b 100644 --- a/test/hotspot/jtreg/compiler/floatingpoint/TestPow2.java +++ b/test/hotspot/jtreg/compiler/floatingpoint/TestPow2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:-BackgroundCompilation -XX:-UseOnStackReplacement * compiler.floatingpoint.TestPow2 diff --git a/test/hotspot/jtreg/compiler/gcbarriers/EqvUncastStepOverBarrier.java b/test/hotspot/jtreg/compiler/gcbarriers/EqvUncastStepOverBarrier.java index 532f490a112..5bff1be35ae 100644 --- a/test/hotspot/jtreg/compiler/gcbarriers/EqvUncastStepOverBarrier.java +++ b/test/hotspot/jtreg/compiler/gcbarriers/EqvUncastStepOverBarrier.java @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-UseOnStackReplacement -XX:-TieredCompilation -XX:-BackgroundCompilation EqvUncastStepOverBarrier */ diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/Utils.h b/test/hotspot/jtreg/compiler/graalunit/HotspotJdk15Test.java similarity index 58% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/Utils.h rename to test/hotspot/jtreg/compiler/graalunit/HotspotJdk15Test.java index 3f8e662ea34..e6aed774614 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/Utils.h +++ b/test/hotspot/jtreg/compiler/graalunit/HotspotJdk15Test.java @@ -1,12 +1,10 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. + * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -23,18 +21,20 @@ * questions. */ -#ifndef UTILS_H -#define UTILS_H - -#include -#include "jni.h" - -using namespace std; - -wstring GetStringFromJString(JNIEnv *pEnv, jstring jstr); -jstring GetJStringFromString(JNIEnv *pEnv, const jchar *unicodeChars, - jsize len); - -wstring GetLongPath(wstring path); +/* + * @test + * @summary + * @requires vm.jvmci + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.hotspot.jdk15.test -exclude ExcludeList.txt + */ -#endif // UTILS_H +/* DO NOT MODIFY THIS FILE. GENERATED BY generateTests.sh */ diff --git a/test/hotspot/jtreg/compiler/graalunit/TestPackages.txt b/test/hotspot/jtreg/compiler/graalunit/TestPackages.txt index 1145ae6275d..dd6c841b98f 100644 --- a/test/hotspot/jtreg/compiler/graalunit/TestPackages.txt +++ b/test/hotspot/jtreg/compiler/graalunit/TestPackages.txt @@ -15,6 +15,7 @@ Hotspot org.graalvm.compiler.hotspot.test HotspotAarch64 org.graalvm.compiler.hotspot.aarch64.test HotspotAmd64 org.graalvm.compiler.hotspot.amd64.test HotspotJdk9 org.graalvm.compiler.hotspot.jdk9.test --vmargs --add-opens=java.base/java.lang=ALL-UNNAMED +HotspotJdk15 org.graalvm.compiler.hotspot.jdk15.test HotspotSparc org.graalvm.compiler.hotspot.sparc.test --requires vm.simpleArch=="sparcv9" HotspotLir org.graalvm.compiler.hotspot.lir.test Loop org.graalvm.compiler.loop.test diff --git a/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java b/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java index d0fcdfa27a7..89f50ab3f1f 100644 --- a/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java +++ b/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java @@ -278,7 +278,7 @@ public static void main(String... args) throws Exception { javaFlags.add("@"+GENERATED_TESTCLASSES_FILENAME); ProcessBuilder javaPB = ProcessTools.createJavaProcessBuilder(true, - javaFlags.toArray(new String[javaFlags.size()])); + javaFlags); // Some tests rely on MX_SUBPROCESS_COMMAND_FILE env variable which contains // name of the file with java executable and java args used to launch the current process. diff --git a/test/hotspot/jtreg/compiler/interpreter/DisableOSRTest.java b/test/hotspot/jtreg/compiler/interpreter/DisableOSRTest.java index d115246c748..47481918816 100644 --- a/test/hotspot/jtreg/compiler/interpreter/DisableOSRTest.java +++ b/test/hotspot/jtreg/compiler/interpreter/DisableOSRTest.java @@ -30,7 +30,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+PrintCompilation * -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:-UseOnStackReplacement * compiler.interpreter.DisableOSRTest diff --git a/test/hotspot/jtreg/compiler/intrinsics/IntrinsicAvailableTest.java b/test/hotspot/jtreg/compiler/intrinsics/IntrinsicAvailableTest.java index a2ca8d50837..1bf2c504ff4 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/IntrinsicAvailableTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/IntrinsicAvailableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI diff --git a/test/hotspot/jtreg/compiler/intrinsics/IntrinsicDisabledTest.java b/test/hotspot/jtreg/compiler/intrinsics/IntrinsicDisabledTest.java index 14edaf4e495..bacddfefa21 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/IntrinsicDisabledTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/IntrinsicDisabledTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI diff --git a/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java b/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java index d3d212c1c8b..48baa5e5b8b 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java +++ b/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java @@ -27,7 +27,7 @@ * @summary tests java.util.Base64 * @library /test/lib / * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @run driver ClassFileInstaller sun.hotspot.WhiteBox * * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. diff --git a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java index 1b9d0c883c6..271dd7e41fe 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * compiler.intrinsics.bigInteger.MontgomeryMultiplyTest */ diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/BMITestRunner.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/BMITestRunner.java index 1f1bb0b6cb1..6d3dba1cd0f 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/BMITestRunner.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/BMITestRunner.java @@ -146,8 +146,7 @@ public static OutputAnalyzer runTest(Class expr, new Integer(iterations).toString() }); - OutputAnalyzer outputAnalyzer = ProcessTools. - executeTestJvm(vmOpts.toArray(new String[vmOpts.size()])); + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(vmOpts); outputAnalyzer.shouldHaveExitValue(0); diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnI.java index b1bcc214013..687623213b2 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnI.java @@ -32,7 +32,6 @@ * java.management * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI compiler.intrinsics.bmi.TestAndnI */ diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnL.java index 7f13ffb0b9f..32e83623693 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnL.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestAndnL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiI.java index 2de46dcb835..02a06b2a9dd 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiI.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestBlsiI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java index 512acaf0d8e..fb05b98beb2 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestBlsiL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskI.java index 5bc6b511e99..3c2795c4afa 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskI.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestBlsmskI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskL.java index 5a97e036b45..8be4dd09ffd 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskL.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestBlsmskL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrI.java index 192d0b8fb12..b68e107c721 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrI.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestBlsrI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrL.java index 013bf7b57f5..fb1a526b3f6 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrL.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestBlsrL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java index 8d4a072a9c7..0ba9d0cf9ac 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestLzcntI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntL.java index 11f680c12d9..e9807d8589f 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntL.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestLzcntL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntI.java index a2275a93f9b..b08dc8fe170 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntI.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestTzcntI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntL.java index 69a432a8b6d..ac40f22eaa1 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntL.java @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.bmi.TestTzcntL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/AndnTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/AndnTestI.java index 62701568740..1418d2815da 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/AndnTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/AndnTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions * compiler.intrinsics.bmi.verifycode.AndnTestI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/AndnTestL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/AndnTestL.java index 5f5360c80c1..a6c8d0f660a 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/AndnTestL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/AndnTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/bootclasspath/othervm -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions * compiler.intrinsics.bmi.verifycode.AndnTestL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java index a0829542b17..31c452e340f 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions * compiler.intrinsics.bmi.verifycode.BlsiTestI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestL.java index f88e4102332..5727117388c 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsiTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions * compiler.intrinsics.bmi.verifycode.BlsiTestL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java index 2ff8c6b60b1..c1bcceab90c 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions * compiler.intrinsics.bmi.verifycode.BlsmskTestI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java index 3b0b9004a88..4cbc1eabfe7 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions * compiler.intrinsics.bmi.verifycode.BlsmskTestL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java index 5686d2f5a53..ce601719d0b 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions * compiler.intrinsics.bmi.verifycode.BlsrTestI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestL.java index f821f65894b..1f6e9f5d77e 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BlsrTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseBMI1Instructions * compiler.intrinsics.bmi.verifycode.BlsrTestL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/LZcntTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/LZcntTestI.java index 1baec58f533..d56b88664cb 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/LZcntTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/LZcntTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction * compiler.intrinsics.bmi.verifycode.LZcntTestI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/LZcntTestL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/LZcntTestL.java index eaa7c526df6..50ed1aaafd0 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/LZcntTestL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/LZcntTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountLeadingZerosInstruction * compiler.intrinsics.bmi.verifycode.LZcntTestL diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/TZcntTestI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/TZcntTestI.java index 154757268ad..acb5845f38a 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/TZcntTestI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/TZcntTestI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction * compiler.intrinsics.bmi.verifycode.TZcntTestI diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/TZcntTestL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/TZcntTestL.java index f08f37fd1d0..96995e54757 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/TZcntTestL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/TZcntTestL.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCountTrailingZerosInstruction * compiler.intrinsics.bmi.verifycode.TZcntTestL diff --git a/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java b/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java index 5fd41842e3a..058524a03e2 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -Xmixed -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:CompileThreshold=1000 * -XX:CompileCommand=exclude,compiler.intrinsics.klass.CastNullCheckDroppingsTest::runTest diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java index cc95c6e712c..b020e23270b 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/AddExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java index 1ef33c42458..094135c5237 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/AddExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java index 6c996230c31..9f29141ee71 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java index c1fad956ec1..565c2e66eeb 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java index 98133d758ae..1b0d688204e 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java index e5c4c3ca13c..7ab05737fd3 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java index 86a432bcce4..c014e84009a 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java index 65cc2842419..9b480ac0d49 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java index f6ea0168066..f6ecaa1084a 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java index 50e5095be1c..820ed8fbed6 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java index d64757dec5d..843d8e692fc 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java index f3a024ac471..8280c47cff1 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ * java.management * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+IgnoreUnrecognizedVMOptions -XX:+WhiteBoxAPI -XX:+LogCompilation * -XX:CompileCommand=compileonly,compiler.intrinsics.mathexact.sanity.MathIntrinsic*::execMathMethod diff --git a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java index 7602829ce3b..5662b970c95 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java +++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnSupportedCPU diff --git a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java index 558b4218f0b..ab6ea5e11a8 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java +++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA1IntrinsicsOptionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.sha.cli.TestUseSHA1IntrinsicsOptionOnUnsupportedCPU diff --git a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java index 92e4c33eef9..26e20400349 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java +++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnSupportedCPU diff --git a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java index 3ed72bf0a99..75b680d7181 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java +++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA256IntrinsicsOptionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.sha.cli.TestUseSHA256IntrinsicsOptionOnUnsupportedCPU diff --git a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java index d06494613fb..222a48f46cd 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java +++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnSupportedCPU diff --git a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java index c05cf309dae..d09e115dca5 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java +++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHA512IntrinsicsOptionOnUnsupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.sha.cli.TestUseSHA512IntrinsicsOptionOnUnsupportedCPU diff --git a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java index cc95d3c29ae..102ad506cd9 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java +++ b/test/hotspot/jtreg/compiler/intrinsics/sha/cli/TestUseSHAOptionOnSupportedCPU.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ * * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI * compiler.intrinsics.sha.cli.TestUseSHAOptionOnSupportedCPU diff --git a/test/hotspot/jtreg/c