diff --git a/.github/workflows/submit.yml b/.github/workflows/submit.yml index 0a719f8fa37c4..ebe723817382b 100644 --- a/.github/workflows/submit.yml +++ b/.github/workflows/submit.yml @@ -368,8 +368,8 @@ jobs: "$HOME/linux-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip" . -i *.jtr - -i hs_err* - -i replay* + -i */hs_err*.log + -i */replay*.log continue-on-error: true - name: Persist test results @@ -655,8 +655,8 @@ jobs: "$HOME/linux-x86${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip" . -i *.jtr - -i hs_err* - -i replay* + -i */hs_err*.log + -i */replay*.log continue-on-error: true - name: Persist test results @@ -971,8 +971,8 @@ jobs: "$HOME/windows-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip" . -i *.jtr - -i hs_err* - -i replay* + -i */hs_err*.log + -i */replay*.log continue-on-error: true - name: Persist test results @@ -1253,8 +1253,8 @@ jobs: "$HOME/macos-x64${{ matrix.artifact }}_testsupport_${{ env.logsuffix }}.zip" . -i *.jtr - -i hs_err* - -i replay* + -i */hs_err*.log + -i */replay*.log continue-on-error: true - name: Persist test results diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index de462291b096a..e8997e0da837b 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -184,10 +184,6 @@ ifeq ($(call isTargetOs, windows), true) java.desktop_EXCLUDES += com/sun/java/swing/plaf/gtk endif -ifdef BUILD_HEADLESS_ONLY - java.desktop_EXCLUDES += sun/applet -endif - ifeq ($(call isTargetOs, windows macosx), false) java.desktop_EXCLUDE_FILES += sun/awt/AWTCharset.java endif @@ -389,11 +385,11 @@ endif ################################################################################ -jdk.incubator.jpackage_COPY += .gif .png .txt .spec .script .prerm .preinst \ +jdk.jpackage_COPY += .gif .png .txt .spec .script .prerm .preinst \ .postrm .postinst .list .sh .desktop .copyright .control .plist .template \ .icns .scpt .wxs .wxl .wxi .ico .bmp .tiff -jdk.incubator.jpackage_CLEAN += .properties +jdk.jpackage_CLEAN += .properties ################################################################################ diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index eeab75cde903d..d4738ad6837cb 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -663,16 +663,10 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], $1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DARCH='\"$FLAGS_CPU_LEGACY\"' \ -D$FLAGS_CPU_LEGACY" - if test "x$FLAGS_CPU_BITS" = x64; then - # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in - # unpack200.exe. - if test "x$FLAGS_OS" = xlinux || test "x$FLAGS_OS" = xmacosx; then - $1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1" - fi - if test "x$FLAGS_OS" != xaix; then - # xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it. - $1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1" - fi + if test "x$FLAGS_CPU_BITS" = x64 && test "x$FLAGS_OS" != xaix; then + # xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it. + $1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1" + $1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1" fi # toolchain dependend, per-cpu diff --git a/make/autoconf/jvm-features.m4 b/make/autoconf/jvm-features.m4 index 04ca7b4e909d5..5ad791795a740 100644 --- a/make/autoconf/jvm-features.m4 +++ b/make/autoconf/jvm-features.m4 @@ -306,7 +306,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_GRAAL], # Graal is only available where JVMCI is available since it requires JVMCI. if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then AC_MSG_RESULT([yes]) - elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then + elif test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU]) @@ -340,7 +340,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JVMCI], AC_MSG_CHECKING([if platform is supported by JVMCI]) if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then AC_MSG_RESULT([yes]) - elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then + elif test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU]) diff --git a/make/common/JdkNativeCompilation.gmk b/make/common/JdkNativeCompilation.gmk index 21134966dc026..6a963ac2c498a 100644 --- a/make/common/JdkNativeCompilation.gmk +++ b/make/common/JdkNativeCompilation.gmk @@ -77,8 +77,10 @@ ifeq ($(STATIC_LIBS), true) FindStaticLib = endif +# Returns the module specific java header dir if it exists. +# Param 1 - module name GetJavaHeaderDir = \ - $(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)) + $(if $(strip $1),$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1))) # Process a dir description such as "java.base:headers" into a set of proper absolute paths. ProcessDir = \ @@ -123,15 +125,27 @@ JDK_RCFLAGS=$(RCFLAGS) \ SetupJdkLibrary = $(NamedParamsMacroTemplate) define SetupJdkLibraryBody ifeq ($$($1_OUTPUT_DIR), ) - $1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE)) + ifneq ($$(MODULE), ) + $1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE)) + else + $$(error Must specify OUTPUT_DIR in a MODULE free context) + endif endif ifeq ($$($1_OBJECT_DIR), ) - $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME) + ifneq ($$(MODULE), ) + $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME) + else + $$(error Must specify OBJECT_DIR in a MODULE free context) + endif endif ifeq ($$($1_SRC), ) - $1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME)) + ifneq ($$(MODULE), ) + $1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME)) + else + $$(error Must specify SRC in a MODULE free context) + endif else $1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir))) endif @@ -165,7 +179,8 @@ define SetupJdkLibraryBody ifneq ($$($1_HEADERS_FROM_SRC), false) $1_SRC_HEADER_FLAGS := $$(addprefix -I, $$(wildcard $$($1_SRC))) endif - # Always add the java header dir + + # Add the module specific java header dir $1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE))) ifneq ($$($1_EXTRA_HEADER_DIRS), ) @@ -203,11 +218,19 @@ define SetupJdkExecutableBody $1_TYPE := EXECUTABLE ifeq ($$($1_OUTPUT_DIR), ) - $1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE)) + ifneq ($$(MODULE), ) + $1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE)) + else + $$(error Must specify OUTPUT_DIR in a MODULE free context) + endif endif ifeq ($$($1_OBJECT_DIR), ) - $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME) + ifneq ($$(MODULE), ) + $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME) + else + $$(error Must specify OBJECT_DIR in a MODULE free context) + endif endif ifeq ($$($1_VERSIONINFO_RESOURCE), ) diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index 62272edd34ab5..10aacff472699 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -125,7 +125,7 @@ endif JRE_TOOL_MODULES += \ jdk.jdwp.agent \ - jdk.incubator.jpackage \ + jdk.jpackage \ # ################################################################################ @@ -145,7 +145,7 @@ DOCS_MODULES += \ jdk.editpad \ jdk.hotspot.agent \ jdk.httpserver \ - jdk.incubator.jpackage \ + jdk.jpackage \ jdk.incubator.vector \ jdk.jartool \ jdk.javadoc \ @@ -228,7 +228,7 @@ endif # jpackage is only on windows, macosx, and linux ifeq ($(call isTargetOs, windows macosx linux), false) - MODULES_FILTER += jdk.incubator.jpackage + MODULES_FILTER += jdk.jpackage endif ################################################################################ diff --git a/make/data/tzdata/VERSION b/make/data/tzdata/VERSION index f5b7dba32a422..94ba7462f2e0e 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. # -tzdata2020c +tzdata2020d diff --git a/make/data/tzdata/asia b/make/data/tzdata/asia index f5336ef4c26f9..acca6554fa2fe 100644 --- a/make/data/tzdata/asia +++ b/make/data/tzdata/asia @@ -3244,13 +3244,40 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # 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 Steffen Thorsen (2020-10-20): +# Some sources such as these say, and display on clocks, that DST ended at +# midnight last year... +# https://www.amad.ps/ar/post/320006 +# +# From Tim Parenti (2020-10-20): +# The report of the Palestinian Cabinet meeting of 2019-10-14 confirms +# a decision on (translated): "The start of the winter time in Palestine, by +# delaying the clock by sixty minutes, starting from midnight on Friday / +# Saturday corresponding to 26/10/2019." +# http://www.palestinecabinet.gov.ps/portal/meeting/details/43948 + +# From Sharef Mustafa (2020-10-20): +# As per the palestinian cabinet announcement yesterday , the day light saving +# shall [end] on Oct 24th 2020 at 01:00AM by delaying the clock by 60 minutes. +# http://www.palestinecabinet.gov.ps/portal/Meeting/Details/51584 + +# From Tim Parenti (2020-10-20): +# Predict future fall transitions at 01:00 on the Saturday preceding October's +# last Sunday (i.e., Sat>=24). This is consistent with our predictions since +# 2016, although the time of the change differed slightly in 2019. + +# From Pierre Cashon (2020-10-20): +# The summer time this year started on March 28 at 00:00. +# https://wafa.ps/ar_page.aspx?id=GveQNZa872839351758aGveQNZ +# http://www.palestinecabinet.gov.ps/portal/meeting/details/50284 +# The winter time in 2015 started on October 23 at 01:00. +# https://wafa.ps/ar_page.aspx?id=CgpCdYa670694628582aCgpCdY +# http://www.palestinecabinet.gov.ps/portal/meeting/details/27583 # -# From Tim Parenti (2016-10-19): -# Predict fall transitions on October's last Saturday at 01:00 from now on. +# From Paul Eggert (2019-04-10): +# For now, guess spring-ahead transitions are at 00:00 on the Saturday +# preceding March's last Sunday (i.e., Sat>=24). # Rule NAME FROM TO - IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -3266,10 +3293,10 @@ Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - -Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - +Rule Palestine 2007 only - Sep 13 2:00 0 - Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S Rule Palestine 2008 only - Sep 1 0:00 0 - -Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2009 only - Sep 4 1:00 0 - Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - Rule Palestine 2011 only - Apr 1 0:01 1:00 S @@ -3278,12 +3305,16 @@ Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - Rule Palestine 2012 2014 - Mar lastThu 24:00 1:00 S Rule Palestine 2012 only - Sep 21 1:00 0 - -Rule Palestine 2013 only - Sep Fri>=21 0:00 0 - -Rule Palestine 2014 2015 - Oct Fri>=21 0:00 0 - -Rule Palestine 2015 only - Mar lastFri 24:00 1:00 S +Rule Palestine 2013 only - Sep 27 0:00 0 - +Rule Palestine 2014 only - Oct 24 0:00 0 - +Rule Palestine 2015 only - Mar 28 0:00 1:00 S +Rule Palestine 2015 only - Oct 23 1:00 0 - Rule Palestine 2016 2018 - Mar Sat>=24 1:00 1:00 S -Rule Palestine 2016 max - Oct lastSat 1:00 0 - -Rule Palestine 2019 max - Mar lastFri 0:00 1:00 S +Rule Palestine 2016 2018 - Oct Sat>=24 1:00 0 - +Rule Palestine 2019 only - Mar 29 0:00 1:00 S +Rule Palestine 2019 only - Oct Sat>=24 0:00 0 - +Rule Palestine 2020 max - Mar Sat>=24 0:00 1:00 S +Rule Palestine 2020 max - Oct Sat>=24 1:00 0 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct diff --git a/make/data/tzdata/europe b/make/data/tzdata/europe index 2b0c7be51c3a8..adb260624dc86 100644 --- a/make/data/tzdata/europe +++ b/make/data/tzdata/europe @@ -1052,17 +1052,16 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # Denmark, Faroe Islands, and Greenland # From Jesper Nørgaard Welen (2005-04-26): -# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law -# [introducing standard time] was in effect from 1894-01-01.... -# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL +# the law [introducing standard time] was in effect from 1894-01-01.... +# The page https://www.retsinformation.dk/eli/lta/1893/83 # confirms this, and states that the law was put forth 1893-03-29. # # The EU [actually, EEC and Euratom] treaty with effect from 1973: -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL +# https://www.retsinformation.dk/eli/lta/1972/21100 # # This provoked a new law from 1974 to make possible summer time changes # in subsequent decrees with the law -# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL +# https://www.retsinformation.dk/eli/lta/1974/223 # # It seems however that no decree was set forward until 1980. I have # not found any decree, but in another related law, the effecting DST @@ -1074,7 +1073,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 # The law is about the management of the extra hour, concerning # working hours reported and effect on obligatory-rest rules (which # was suspended on that night): -# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL +# https://web.archive.org/web/20140104053304/https://www.retsinformation.dk/Forms/R0710.aspx?id=60267 # From Jesper Nørgaard Welen (2005-06-11): # The Herning Folkeblad (1980-09-26) reported that the night between diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk index e58f443c60372..65edd047571c3 100644 --- a/make/hotspot/lib/CompileJvm.gmk +++ b/make/hotspot/lib/CompileJvm.gmk @@ -91,7 +91,7 @@ DISABLED_WARNINGS_clang := tautological-compare \ undefined-var-template sometimes-uninitialized unknown-pragmas \ delete-non-virtual-dtor missing-braces char-subscripts \ ignored-qualifiers missing-field-initializers mismatched-tags \ - shift-negative-value + shift-negative-value misleading-indentation DISABLED_WARNINGS_xlc := tautological-compare shift-negative-value diff --git a/make/hotspot/symbols/symbols-unix b/make/hotspot/symbols/symbols-unix index 7504ed52c324d..1781d84ab942f 100644 --- a/make/hotspot/symbols/symbols-unix +++ b/make/hotspot/symbols/symbols-unix @@ -171,11 +171,13 @@ JVM_NativePath JVM_NewArray JVM_NewInstanceFromConstructor JVM_NewMultiArray +JVM_PhantomReferenceRefersTo JVM_RaiseSignal JVM_RawMonitorCreate JVM_RawMonitorDestroy JVM_RawMonitorEnter JVM_RawMonitorExit +JVM_ReferenceRefersTo JVM_RegisterLambdaProxyClassForArchiving JVM_RegisterSignal JVM_ReleaseUTF diff --git a/make/modules/java.base/lib/CoreLibraries.gmk b/make/modules/java.base/lib/CoreLibraries.gmk index f2b94fe717ef8..1d5fede2aa8af 100644 --- a/make/modules/java.base/lib/CoreLibraries.gmk +++ b/make/modules/java.base/lib/CoreLibraries.gmk @@ -49,7 +49,7 @@ $(eval $(call SetupNativeCompilation, BUILD_LIBFDLIBM, \ CFLAGS_windows_debug := -DLOGGING, \ CFLAGS_aix := -qfloat=nomaf, \ DISABLED_WARNINGS_gcc := sign-compare misleading-indentation array-bounds, \ - DISABLED_WARNINGS_clang := sign-compare, \ + DISABLED_WARNINGS_clang := sign-compare misleading-indentation, \ DISABLED_WARNINGS_microsoft := 4146 4244 4018, \ ARFLAGS := $(ARFLAGS), \ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libfdlibm, \ diff --git a/make/modules/jdk.javadoc/Gendata.gmk b/make/modules/jdk.javadoc/Gendata.gmk index 5b4485808c7ca..0ee146a1e2197 100644 --- a/make/modules/jdk.javadoc/Gendata.gmk +++ b/make/modules/jdk.javadoc/Gendata.gmk @@ -54,7 +54,7 @@ $(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \ 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, \ + BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javadoc, \ DISABLED_WARNINGS := options, \ JAVAC_FLAGS := \ $(INTERIM_LANGTOOLS_ARGS) \ @@ -71,7 +71,7 @@ $(SUPPORT_OUTPUTDIR)/javadoc-symbols/symbols: \ $(ECHO) Creating javadoc element list $(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \ $(COMPILECREATESYMBOLS_ADD_EXPORTS) \ - -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \ + -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javadoc \ build.tools.symbolgenerator.CreateSymbols \ build-javadoc-data \ $(CT_DATA_DESCRIPTION) \ @@ -79,7 +79,7 @@ $(SUPPORT_OUTPUTDIR)/javadoc-symbols/symbols: \ 11 $(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \ $(COMPILECREATESYMBOLS_ADD_EXPORTS) \ - -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \ + -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javadoc \ build.tools.symbolgenerator.JavadocElementList \ $(JDK_OUTPUTDIR)/modules/jdk.javadoc/jdk/javadoc/internal/doclets/toolkit/resources/releases/element-list-$(JDK_SOURCE_TARGET_VERSION).txt \ $(JAVADOC_MODULESOURCEPATH) \ diff --git a/make/modules/jdk.incubator.jpackage/Gensrc.gmk b/make/modules/jdk.jpackage/Gensrc.gmk similarity index 93% rename from make/modules/jdk.incubator.jpackage/Gensrc.gmk rename to make/modules/jdk.jpackage/Gensrc.gmk index 5948a80f12071..6f3e8b08119c2 100644 --- a/make/modules/jdk.incubator.jpackage/Gensrc.gmk +++ b/make/modules/jdk.jpackage/Gensrc.gmk @@ -31,7 +31,7 @@ include GensrcCommonJdk.gmk ifeq ($(call isTargetOs, macosx), true) ENTITLEMENTS_SRC_FILE := $(TOPDIR)/make/data/macosxsigning/java.plist ENTITLEMENTS_TARGET_FILE := \ - $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/jdk/incubator/jpackage/internal/resources/entitlements.plist + $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/jdk/jpackage/internal/resources/entitlements.plist $(ENTITLEMENTS_TARGET_FILE): $(ENTITLEMENTS_SRC_FILE) $(call install-file) diff --git a/make/modules/jdk.incubator.jpackage/Launcher.gmk b/make/modules/jdk.jpackage/Launcher.gmk similarity index 95% rename from make/modules/jdk.incubator.jpackage/Launcher.gmk rename to make/modules/jdk.jpackage/Launcher.gmk index 7a25dae733c37..8d553d5c10750 100644 --- a/make/modules/jdk.incubator.jpackage/Launcher.gmk +++ b/make/modules/jdk.jpackage/Launcher.gmk @@ -26,5 +26,5 @@ include LauncherCommon.gmk $(eval $(call SetupBuildLauncher, jpackage, \ - MAIN_CLASS := jdk.incubator.jpackage.main.Main, \ + MAIN_CLASS := jdk.jpackage.main.Main, \ )) diff --git a/make/modules/jdk.incubator.jpackage/Lib.gmk b/make/modules/jdk.jpackage/Lib.gmk similarity index 91% rename from make/modules/jdk.incubator.jpackage/Lib.gmk rename to make/modules/jdk.jpackage/Lib.gmk index 7ffef99afe4eb..7dfb70be5a6df 100644 --- a/make/modules/jdk.incubator.jpackage/Lib.gmk +++ b/make/modules/jdk.jpackage/Lib.gmk @@ -29,8 +29,8 @@ include LibCommon.gmk JPACKAGE_APPLAUNCHER_SRC := \ - $(call FindSrcDirsForComponent, jdk.incubator.jpackage, applauncher) \ - $(call FindSrcDirsForComponent, jdk.incubator.jpackage, common) + $(call FindSrcDirsForComponent, jdk.jpackage, applauncher) \ + $(call FindSrcDirsForComponent, jdk.jpackage, common) ifeq ($(call isTargetOs, windows), true) @@ -42,7 +42,7 @@ else endif -JPACKAGE_OUTPUT_DIR := $(JDK_OUTPUTDIR)/modules/$(MODULE)/jdk/incubator/jpackage/internal/resources +JPACKAGE_OUTPUT_DIR := $(JDK_OUTPUTDIR)/modules/$(MODULE)/jdk/jpackage/internal/resources JPACKAGE_CXXFLAGS_windows := -EHsc -DUNICODE -D_UNICODE # Output app launcher executable in resources dir, and symbols in the object dir @@ -73,7 +73,7 @@ ifeq ($(call isTargetOs, windows), true) $(eval $(call SetupJdkLibrary, BUILD_LIB_JPACKAGE, \ NAME := jpackage, \ OPTIMIZATION := LOW, \ - EXTRA_SRC := jdk.incubator.jpackage:common, \ + EXTRA_SRC := jdk.jpackage:common, \ CXXFLAGS := $(CXXFLAGS_JDKLIB) $(JPACKAGE_CXXFLAGS_windows), \ LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ @@ -99,8 +99,8 @@ ifeq ($(call isTargetOs, windows), true) TARGETS += $(BUILD_LIB_WIXHELPER) JPACKAGE_MSIWRAPPER_SRC := \ - $(call FindSrcDirsForComponent, jdk.incubator.jpackage, msiwrapper) \ - $(call FindSrcDirsForComponent, jdk.incubator.jpackage, common) + $(call FindSrcDirsForComponent, jdk.jpackage, msiwrapper) \ + $(call FindSrcDirsForComponent, jdk.jpackage, common) # Build exe installer wrapper for msi installer $(eval $(call SetupJdkExecutable, BUILD_JPACKAGE_MSIWRAPPER, \ diff --git a/make/scripts/compare.sh b/make/scripts/compare.sh index 25630199a21cf..5d0e846e755ee 100644 --- a/make/scripts/compare.sh +++ b/make/scripts/compare.sh @@ -696,7 +696,7 @@ compare_bin_file() { # pdb files. PDB_DIRS="$(ls -d \ {$OTHER,$THIS}/support/modules_{cmds,libs}/{*,*/*} \ - {$OTHER,$THIS}/support/native/jdk.incubator.jpackage/* \ + {$OTHER,$THIS}/support/native/jdk.jpackage/* \ )" export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')" fi diff --git a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp index ba352461e4a9d..c1af5d1ef14c1 100644 --- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp @@ -3220,13 +3220,6 @@ void mvnw(Register Rd, Register Rm, Assembler(CodeBuffer* code) : AbstractAssembler(code) { } - virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset) { - ShouldNotCallThis(); - return RegisterOrConstant(); - } - // Stack overflow checking virtual void bang_stack_with_offset(int offset); diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp index b3530509b032a..db9c7577e6081 100644 --- a/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shenandoah/c1/shenandoahBarrierSetC1_aarch64.cpp @@ -109,7 +109,7 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRIt __ xchg(access.resolved_addr(), value_opr, result, tmp); if (access.is_oop()) { - result = load_reference_barrier(access.gen(), result, LIR_OprFact::addressConst(0), false); + result = load_reference_barrier(access.gen(), result, LIR_OprFact::addressConst(0), ShenandoahBarrierSet::AccessKind::NORMAL); LIR_Opr tmp = gen->new_register(type); __ move(result, tmp); result = tmp; diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp index 16acaa6797ec4..840464b251f4f 100644 --- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp @@ -225,7 +225,7 @@ void ShenandoahBarrierSetAssembler::resolve_forward_pointer_not_null(MacroAssemb } } -void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr, bool weak) { +void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr, ShenandoahBarrierSet::AccessKind kind) { assert(ShenandoahLoadRefBarrier, "Should be enabled"); assert(dst != rscratch2, "need rscratch2"); assert_different_registers(load_addr.base(), load_addr.index(), rscratch1, rscratch2); @@ -252,7 +252,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, __ mov(r0, dst); // Test for in-cset - if (!weak) { + if (kind == ShenandoahBarrierSet::AccessKind::NORMAL) { __ mov(rscratch2, ShenandoahHeap::in_cset_fast_test_addr()); __ lsr(rscratch1, r0, ShenandoahHeapRegion::region_size_bytes_shift_jint()); __ ldrb(rscratch2, Address(rscratch2, rscratch1)); @@ -260,14 +260,26 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, } __ push_call_clobbered_registers(); - if (weak) { - __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)); - } else { - if (UseCompressedOops) { - __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow)); - } else { - __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier)); - } + switch (kind) { + case ShenandoahBarrierSet::AccessKind::NORMAL: + if (UseCompressedOops) { + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow)); + } else { + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier)); + } + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + if (UseCompressedOops) { + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow)); + } else { + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)); + } + break; + case ShenandoahBarrierSet::AccessKind::NATIVE: + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)); + break; + default: + ShouldNotReachHere(); } __ blr(lr); __ mov(rscratch1, r0); @@ -326,8 +338,8 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread); - bool weak = ShenandoahBarrierSet::use_load_reference_barrier_weak(decorators, type); - load_reference_barrier(masm, dst, src, weak); + ShenandoahBarrierSet::AccessKind kind = ShenandoahBarrierSet::access_kind(decorators, type); + load_reference_barrier(masm, dst, src, kind); if (dst != result_dst) { __ mov(result_dst, dst); @@ -641,10 +653,18 @@ void ShenandoahBarrierSetAssembler::gen_load_reference_barrier_stub(LIR_Assemble __ bind(slow_path); ce->store_parameter(res, 0); ce->store_parameter(addr, 1); - if (stub->is_weak()) { - __ far_call(RuntimeAddress(bs->load_reference_barrier_weak_rt_code_blob()->code_begin())); - } else { - __ far_call(RuntimeAddress(bs->load_reference_barrier_rt_code_blob()->code_begin())); + switch (stub->kind()) { + case ShenandoahBarrierSet::AccessKind::NORMAL: + __ far_call(RuntimeAddress(bs->load_reference_barrier_normal_rt_code_blob()->code_begin())); + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + __ far_call(RuntimeAddress(bs->load_reference_barrier_weak_rt_code_blob()->code_begin())); + break; + case ShenandoahBarrierSet::AccessKind::NATIVE: + __ far_call(RuntimeAddress(bs->load_reference_barrier_native_rt_code_blob()->code_begin())); + break; + default: + ShouldNotReachHere(); } __ b(*stub->continuation()); @@ -700,19 +720,33 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss __ epilogue(); } -void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, bool is_weak) { +void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, ShenandoahBarrierSet::AccessKind kind) { __ prologue("shenandoah_load_reference_barrier", false); // arg0 : object to be resolved __ push_call_clobbered_registers(); __ load_parameter(0, r0); __ load_parameter(1, r1); - if (is_weak) { - __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)); - } else if (UseCompressedOops) { - __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow)); - } else { - __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier)); + switch (kind) { + case ShenandoahBarrierSet::AccessKind::NORMAL: + if (UseCompressedOops) { + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow)); + } else { + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier)); + } + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + if (UseCompressedOops) { + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow)); + } else { + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)); + } + break; + case ShenandoahBarrierSet::AccessKind::NATIVE: + __ mov(lr, CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)); + break; + default: + ShouldNotReachHere(); } __ blr(lr); __ mov(rscratch1, r0); diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp index 823880f85f1c5..60303725fd8a1 100644 --- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp @@ -27,6 +27,7 @@ #include "asm/macroAssembler.hpp" #include "gc/shared/barrierSetAssembler.hpp" +#include "gc/shenandoah/shenandoahBarrierSet.hpp" #ifdef COMPILER1 class LIR_Assembler; class ShenandoahPreBarrierStub; @@ -55,7 +56,7 @@ class ShenandoahBarrierSetAssembler: public BarrierSetAssembler { void resolve_forward_pointer(MacroAssembler* masm, Register dst, Register tmp = noreg); void resolve_forward_pointer_not_null(MacroAssembler* masm, Register dst, Register tmp = noreg); - void load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr, bool weak); + void load_reference_barrier(MacroAssembler* masm, Register dst, Address load_addr, ShenandoahBarrierSet::AccessKind kind); public: @@ -65,7 +66,7 @@ class ShenandoahBarrierSetAssembler: public BarrierSetAssembler { void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub); void gen_load_reference_barrier_stub(LIR_Assembler* ce, ShenandoahLoadReferenceBarrierStub* stub); void generate_c1_pre_barrier_runtime_stub(StubAssembler* sasm); - void generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, bool is_weak); + void generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, ShenandoahBarrierSet::AccessKind kind); #endif virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, diff --git a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp index 3156b4b8e8357..f41d79e102166 100644 --- a/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp @@ -21,8 +21,9 @@ * questions. */ - #include "jvmci/jvmci.hpp" - #include "jvmci/jvmciCodeInstaller.hpp" +#include "precompiled.hpp" +#include "jvmci/jvmci.hpp" +#include "jvmci/jvmciCodeInstaller.hpp" #include "jvmci/jvmciRuntime.hpp" #include "jvmci/jvmciCompilerToVM.hpp" #include "jvmci/jvmciJavaClasses.hpp" diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp index 19c3aefe1154f..005ad3f5930a9 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp @@ -934,23 +934,6 @@ void MacroAssembler::check_and_handle_earlyret(Register java_thread) { } void MacroAssembler::check_and_handle_popframe(Register java_thread) { } - -RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset) { - intptr_t value = *delayed_value_addr; - if (value != 0) - return RegisterOrConstant(value + offset); - - // load indirectly to solve generation ordering problem - ldr(tmp, ExternalAddress((address) delayed_value_addr)); - - if (offset != 0) - add(tmp, tmp, offset); - - return RegisterOrConstant(tmp); -} - // Look up the method for a megamorphic invokeinterface call. // The target method is determined by . // The receiver klass is in recv_klass. diff --git a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp index 2d4e525067bde..1d597fb429c56 100644 --- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp @@ -1013,10 +1013,6 @@ class MacroAssembler: public Assembler { // Check for reserved stack access in method being exited (for JIT) void reserved_stack_check(); - virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset); - // Arithmetics void addptr(const Address &dst, int32_t src); diff --git a/src/hotspot/cpu/arm/macroAssembler_arm.cpp b/src/hotspot/cpu/arm/macroAssembler_arm.cpp index bb984d53d60a4..067ec70437643 100644 --- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp @@ -85,20 +85,6 @@ void AddressLiteral::set_rspec(relocInfo::relocType rtype) { } } -// Initially added to the Assembler interface as a pure virtual: -// RegisterConstant delayed_value(..) -// for: -// 6812678 macro assembler needs delayed binding of a few constants (for 6655638) -// this was subsequently modified to its present name and return type -RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset) { - ShouldNotReachHere(); - return RegisterOrConstant(-1); -} - - - // virtual method calling void MacroAssembler::lookup_virtual_method(Register recv_klass, diff --git a/src/hotspot/cpu/arm/macroAssembler_arm.hpp b/src/hotspot/cpu/arm/macroAssembler_arm.hpp index de40c5741a7d0..a07ca65d99ec0 100644 --- a/src/hotspot/cpu/arm/macroAssembler_arm.hpp +++ b/src/hotspot/cpu/arm/macroAssembler_arm.hpp @@ -222,14 +222,6 @@ class MacroAssembler: public Assembler { // returning false to preserve all relocation information. inline bool ignore_non_patchable_relocations() { return true; } - // Initially added to the Assembler interface as a pure virtual: - // RegisterConstant delayed_value(..) - // for: - // 6812678 macro assembler needs delayed binding of a few constants (for 6655638) - // this was subsequently modified to its present name and return type - virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset); - - void align(int modulus); // Support for VM calls diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp index 4872e036d2b5e..ca1c0c24987b9 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp @@ -382,25 +382,6 @@ AddressLiteral MacroAssembler::constant_oop_address(jobject obj) { return AddressLiteral(address(obj), oop_Relocation::spec(oop_index)); } -RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, int offset) { - intptr_t value = *delayed_value_addr; - if (value != 0) { - return RegisterOrConstant(value + offset); - } - - // Load indirectly to solve generation ordering problem. - // static address, no relocation - int simm16_offset = load_const_optimized(tmp, delayed_value_addr, noreg, true); - ld(tmp, simm16_offset, tmp); // must be aligned ((xa & 3) == 0) - - if (offset != 0) { - addi(tmp, tmp, offset); - } - - return RegisterOrConstant(tmp); -} - #ifndef PRODUCT void MacroAssembler::pd_print_patched_instruction(address branch) { Unimplemented(); // TODO: PPC port diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp index a8e43cabdc40d..1859483c47070 100644 --- a/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp +++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.hpp @@ -152,12 +152,6 @@ class MacroAssembler: public Assembler { // Same as load_address. inline void set_oop (AddressLiteral obj_addr, Register d); - // Read runtime constant: Issue load if constant not yet established, - // else use real constant. - virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset); - // // branch, jump // diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.cpp b/src/hotspot/cpu/s390/macroAssembler_s390.cpp index ffba110d3885a..d7c95ee96ee64 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.cpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.cpp @@ -1810,34 +1810,6 @@ void MacroAssembler::c2bool(Register r, Register t) { z_srl(r, 31); // Yields 0 if r was 0, 1 otherwise. } -RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset) { - intptr_t value = *delayed_value_addr; - if (value != 0) { - return RegisterOrConstant(value + offset); - } - - BLOCK_COMMENT("delayed_value {"); - // Load indirectly to solve generation ordering problem. - load_absolute_address(tmp, (address) delayed_value_addr); // tmp = a; - z_lg(tmp, 0, tmp); // tmp = *tmp; - -#ifdef ASSERT - NearLabel L; - compare64_and_branch(tmp, (intptr_t)0L, Assembler::bcondNotEqual, L); - z_illtrap(); - bind(L); -#endif - - if (offset != 0) { - z_agfi(tmp, offset); // tmp = tmp + offset; - } - - BLOCK_COMMENT("} delayed_value"); - return RegisterOrConstant(tmp); -} - // Patch instruction `inst' at offset `inst_pos' to refer to `dest_pos' // and return the resulting instruction. // Dest_pos and inst_pos are 32 bit only. These parms can only designate diff --git a/src/hotspot/cpu/s390/macroAssembler_s390.hpp b/src/hotspot/cpu/s390/macroAssembler_s390.hpp index 41294b0fe8757..113a1a3db2afc 100644 --- a/src/hotspot/cpu/s390/macroAssembler_s390.hpp +++ b/src/hotspot/cpu/s390/macroAssembler_s390.hpp @@ -350,9 +350,6 @@ class MacroAssembler: public Assembler { // Uses constant_metadata_address. inline bool set_metadata_constant(Metadata* md, Register d); - virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset); // // branch, jump // diff --git a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp index e36b9cda426f3..6853953f0ebe7 100644 --- a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp +++ b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp @@ -80,19 +80,29 @@ void ConversionStub::emit_code(LIR_Assembler* ce) { #endif // !_LP64 void C1SafepointPollStub::emit_code(LIR_Assembler* ce) { -#ifdef _LP64 __ bind(_entry); InternalAddress safepoint_pc(ce->masm()->pc() - ce->masm()->offset() + safepoint_offset()); +#ifdef _LP64 __ lea(rscratch1, safepoint_pc); __ movptr(Address(r15_thread, JavaThread::saved_exception_pc_offset()), rscratch1); +#else + const Register tmp1 = rcx; + const Register tmp2 = rdx; + __ push(tmp1); + __ push(tmp2); + + __ lea(tmp1, safepoint_pc); + __ get_thread(tmp2); + __ movptr(Address(tmp2, JavaThread::saved_exception_pc_offset()), tmp1); + __ pop(tmp2); + __ pop(tmp1); +#endif /* _LP64 */ assert(SharedRuntime::polling_page_return_handler_blob() != NULL, "polling page return stub not created yet"); + address stub = SharedRuntime::polling_page_return_handler_blob()->entry_point(); __ jump(RuntimeAddress(stub)); -#else - ShouldNotReachHere(); -#endif /* _LP64 */ } void CounterOverflowStub::emit_code(LIR_Assembler* ce) { diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp index 48c9896fb9a35..bba946ec4addf 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp @@ -535,17 +535,14 @@ void LIR_Assembler::return_op(LIR_Opr result, C1SafepointPollStub* code_stub) { // the poll sets the condition code, but no data registers #ifdef _LP64 - code_stub->set_safepoint_offset(__ offset()); - __ relocate(relocInfo::poll_return_type); - __ safepoint_poll(*code_stub->entry(), r15_thread, true /* at_return */, true /* in_nmethod */); + const Register thread = r15_thread; #else - const Register poll_addr = rbx; - assert(FrameMap::is_caller_save_register(poll_addr), "will overwrite"); - __ get_thread(poll_addr); - __ movptr(poll_addr, Address(poll_addr, Thread::polling_page_offset())); - __ relocate(relocInfo::poll_return_type); - __ testl(rax, Address(poll_addr, 0)); + const Register thread = rbx; + __ get_thread(thread); #endif + code_stub->set_safepoint_offset(__ offset()); + __ relocate(relocInfo::poll_return_type); + __ safepoint_poll(*code_stub->entry(), thread, true /* at_return */, true /* in_nmethod */); __ ret(0); } diff --git a/src/hotspot/cpu/x86/c2_safepointPollStubTable_x86.cpp b/src/hotspot/cpu/x86/c2_safepointPollStubTable_x86.cpp index 55a923bc58810..c3d4850a5db69 100644 --- a/src/hotspot/cpu/x86/c2_safepointPollStubTable_x86.cpp +++ b/src/hotspot/cpu/x86/c2_safepointPollStubTable_x86.cpp @@ -31,7 +31,6 @@ #define __ masm. void C2SafepointPollStubTable::emit_stub_impl(MacroAssembler& masm, C2SafepointPollStub* entry) const { -#ifdef _LP64 assert(SharedRuntime::polling_page_return_handler_blob() != NULL, "polling page return stub not created yet"); address stub = SharedRuntime::polling_page_return_handler_blob()->entry_point(); @@ -40,11 +39,22 @@ void C2SafepointPollStubTable::emit_stub_impl(MacroAssembler& masm, C2SafepointP __ bind(entry->_stub_label); InternalAddress safepoint_pc(masm.pc() - masm.offset() + entry->_safepoint_offset); +#ifdef _LP64 __ lea(rscratch1, safepoint_pc); __ movptr(Address(r15_thread, JavaThread::saved_exception_pc_offset()), rscratch1); - __ jump(callback_addr); #else - ShouldNotReachHere(); + const Register tmp1 = rcx; + const Register tmp2 = rdx; + __ push(tmp1); + __ push(tmp2); + + __ lea(tmp1, safepoint_pc); + __ get_thread(tmp2); + __ movptr(Address(tmp2, JavaThread::saved_exception_pc_offset()), tmp1); + + __ pop(tmp2); + __ pop(tmp1); #endif + __ jump(callback_addr); } #undef __ diff --git a/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp index 58dcd9ed5fb86..01b53c5266a1e 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp @@ -111,7 +111,7 @@ LIR_Opr ShenandoahBarrierSetC1::atomic_xchg_at_resolved(LIRAccess& access, LIRIt __ xchg(access.resolved_addr(), result, result, LIR_OprFact::illegalOpr); if (access.is_oop()) { - result = load_reference_barrier(access.gen(), result, LIR_OprFact::addressConst(0), false); + result = load_reference_barrier(access.gen(), result, LIR_OprFact::addressConst(0), ShenandoahBarrierSet::AccessKind::NORMAL); LIR_Opr tmp = gen->new_register(type); __ move(result, tmp); result = tmp; diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp index e47acbea8d595..40f16ef273103 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp @@ -268,7 +268,7 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm, __ bind(done); } -void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, Register dst, Address src, bool weak) { +void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, Register dst, Address src, ShenandoahBarrierSet::AccessKind kind) { assert(ShenandoahLoadRefBarrier, "Should be enabled"); Label heap_stable, not_cset; @@ -291,25 +291,34 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, __ testb(gc_state, ShenandoahHeap::HAS_FORWARDED); __ jcc(Assembler::zero, heap_stable); - Register tmp1 = noreg; - if (!weak) { + Register tmp1 = noreg, tmp2 = noreg; + if (kind == ShenandoahBarrierSet::AccessKind::NORMAL) { // Test for object in cset - // Allocate tmp-reg. + // Allocate temporary registers for (int i = 0; i < 8; i++) { Register r = as_Register(i); if (r != rsp && r != rbp && r != dst && r != src.base() && r != src.index()) { - tmp1 = r; - break; + if (tmp1 == noreg) { + tmp1 = r; + } else { + tmp2 = r; + break; + } } } + assert(tmp1 != noreg, "tmp1 allocated"); + assert(tmp2 != noreg, "tmp2 allocated"); + assert_different_registers(tmp1, tmp2, src.base(), src.index()); + assert_different_registers(tmp1, tmp2, dst); + __ push(tmp1); - assert_different_registers(tmp1, src.base(), src.index()); - assert_different_registers(tmp1, dst); + __ push(tmp2); // Optimized cset-test __ movptr(tmp1, dst); __ shrptr(tmp1, ShenandoahHeapRegion::region_size_bytes_shift_jint()); - __ movbool(tmp1, Address(tmp1, (intptr_t) ShenandoahHeap::in_cset_fast_test_addr(), Address::times_1)); + __ movptr(tmp2, (intptr_t) ShenandoahHeap::in_cset_fast_test_addr()); + __ movbool(tmp1, Address(tmp1, tmp2, Address::times_1)); __ testbool(tmp1); __ jcc(Assembler::zero, not_cset); } @@ -333,19 +342,41 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, #endif assert(slot == 0, "must use all slots"); - Register tmp2 = (dst == rsi) ? rdx : rsi; - assert_different_registers(dst, tmp2); - __ lea(tmp2, src); + // Shuffle registers such that dst is in c_rarg0 and addr in c_rarg1. +#ifdef _LP64 + Register arg0 = c_rarg0, arg1 = c_rarg1; +#else + Register arg0 = rdi, arg1 = rsi; +#endif + if (dst == arg1) { + __ lea(arg0, src); + __ xchgptr(arg1, arg0); + } else { + __ lea(arg1, src); + __ movptr(arg0, dst); + } save_xmm_registers(masm); - if (weak) { - __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), dst, tmp2); - } else { - if (UseCompressedOops) { - __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow), dst, tmp2); - } else { - __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier), dst, tmp2); - } + switch (kind) { + case ShenandoahBarrierSet::AccessKind::NORMAL: + if (UseCompressedOops) { + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow), arg0, arg1); + } else { + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier), arg0, arg1); + } + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + if (UseCompressedOops) { + __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow), arg0, arg1); + } else { + __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), arg0, arg1); + } + break; + case ShenandoahBarrierSet::AccessKind::NATIVE: + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), arg0, arg1); + break; + default: + ShouldNotReachHere(); } restore_xmm_registers(masm); @@ -370,7 +401,8 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm, __ bind(not_cset); - if (!weak) { + if (kind == ShenandoahBarrierSet::AccessKind::NORMAL) { + __ pop(tmp2); __ pop(tmp1); } @@ -467,8 +499,8 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread); - bool weak = ShenandoahBarrierSet::use_load_reference_barrier_weak(decorators, type); - load_reference_barrier(masm, dst, src, weak); + ShenandoahBarrierSet::AccessKind kind = ShenandoahBarrierSet::access_kind(decorators, type); + load_reference_barrier(masm, dst, src, kind); // Move loaded oop to final destination if (dst != result_dst) { @@ -818,10 +850,18 @@ void ShenandoahBarrierSetAssembler::gen_load_reference_barrier_stub(LIR_Assemble __ bind(slow_path); ce->store_parameter(res, 0); ce->store_parameter(addr, 1); - if (stub->is_weak()) { - __ call(RuntimeAddress(bs->load_reference_barrier_weak_rt_code_blob()->code_begin())); - } else { - __ call(RuntimeAddress(bs->load_reference_barrier_rt_code_blob()->code_begin())); + switch (stub->kind()) { + case ShenandoahBarrierSet::AccessKind::NORMAL: + __ call(RuntimeAddress(bs->load_reference_barrier_normal_rt_code_blob()->code_begin())); + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + __ call(RuntimeAddress(bs->load_reference_barrier_weak_rt_code_blob()->code_begin())); + break; + case ShenandoahBarrierSet::AccessKind::NATIVE: + __ call(RuntimeAddress(bs->load_reference_barrier_native_rt_code_blob()->code_begin())); + break; + default: + ShouldNotReachHere(); } __ jmp(*stub->continuation()); } @@ -886,7 +926,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss __ epilogue(); } -void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, bool is_weak) { +void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, ShenandoahBarrierSet::AccessKind kind) { __ prologue("shenandoah_load_reference_barrier", false); // arg0 : object to be resolved @@ -895,20 +935,40 @@ void ShenandoahBarrierSetAssembler::generate_c1_load_reference_barrier_runtime_s #ifdef _LP64 __ load_parameter(0, c_rarg0); __ load_parameter(1, c_rarg1); - if (is_weak) { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), c_rarg0, c_rarg1); - } else if (UseCompressedOops) { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow), c_rarg0, c_rarg1); - } else { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier), c_rarg0, c_rarg1); + switch (kind) { + case ShenandoahBarrierSet::AccessKind::NORMAL: + if (UseCompressedOops) { + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow), c_rarg0, c_rarg1); + } else { + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier), c_rarg0, c_rarg1); + } + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + if (UseCompressedOops) { + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow), c_rarg0, c_rarg1); + } else { + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), c_rarg0, c_rarg1); + } + break; + case ShenandoahBarrierSet::AccessKind::NATIVE: + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), c_rarg0, c_rarg1); + break; + default: + ShouldNotReachHere(); } #else __ load_parameter(0, rax); __ load_parameter(1, rbx); - if (is_weak) { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), rax, rbx); - } else { - __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier), rax, rbx); + switch (kind) { + case ShenandoahBarrierSet::AccessKind::NORMAL: + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier), rax, rbx); + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + case ShenandoahBarrierSet::AccessKind::NATIVE: + __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak), rax, rbx); + break; + default: + ShouldNotReachHere(); } #endif diff --git a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp index 9793a607e5994..108b5670206c0 100644 --- a/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.hpp @@ -27,6 +27,8 @@ #include "asm/macroAssembler.hpp" #include "gc/shared/barrierSetAssembler.hpp" +#include "gc/shenandoah/shenandoahBarrierSet.hpp" + #ifdef COMPILER1 class LIR_Assembler; class ShenandoahPreBarrierStub; @@ -62,10 +64,10 @@ class ShenandoahBarrierSetAssembler: public BarrierSetAssembler { void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub); void gen_load_reference_barrier_stub(LIR_Assembler* ce, ShenandoahLoadReferenceBarrierStub* stub); void generate_c1_pre_barrier_runtime_stub(StubAssembler* sasm); - void generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, bool is_weak); + void generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, ShenandoahBarrierSet::AccessKind kind); #endif - void load_reference_barrier(MacroAssembler* masm, Register dst, Address src, bool weak); + void load_reference_barrier(MacroAssembler* masm, Register dst, Address src, ShenandoahBarrierSet::AccessKind kind); void cmpxchg_oop(MacroAssembler* masm, Register res, Address addr, Register oldval, Register newval, diff --git a/src/hotspot/cpu/x86/interp_masm_x86.cpp b/src/hotspot/cpu/x86/interp_masm_x86.cpp index 9c1376a33c688..140dcfc2f0622 100644 --- a/src/hotspot/cpu/x86/interp_masm_x86.cpp +++ b/src/hotspot/cpu/x86/interp_masm_x86.cpp @@ -1959,7 +1959,7 @@ void InterpreterMacroAssembler::profile_switch_case(Register index, void InterpreterMacroAssembler::_interp_verify_oop(Register reg, TosState state, const char* file, int line) { if (state == atos) { - MacroAssembler::_verify_oop(reg, "broken oop", file, line); + MacroAssembler::_verify_oop_checked(reg, "broken oop", file, line); } } diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 81303ea76c427..d7fabfbbedb32 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -370,11 +370,6 @@ void MacroAssembler::pushptr(AddressLiteral src) { } } -void MacroAssembler::set_word_if_not_zero(Register dst) { - xorl(dst, dst); - set_byte_if_not_zero(dst); -} - static void pass_arg0(MacroAssembler* masm, Register arg) { masm->push(arg); } @@ -714,8 +709,12 @@ void MacroAssembler::movptr(Register dst, ArrayAddress src) { // src should NEVER be a real pointer. Use AddressLiteral for true pointers void MacroAssembler::movptr(Address dst, intptr_t src) { - mov64(rscratch1, src); - movq(dst, rscratch1); + if (is_simm32(src)) { + movptr(dst, checked_cast(src)); + } else { + mov64(rscratch1, src); + movq(dst, rscratch1); + } } // These are mostly for initializing NULL @@ -2761,15 +2760,13 @@ void MacroAssembler::save_rax(Register tmp) { } void MacroAssembler::safepoint_poll(Label& slow_path, Register thread_reg, bool at_return, bool in_nmethod) { -#ifdef _LP64 if (at_return) { // Note that when in_nmethod is set, the stack pointer is incremented before the poll. Therefore, // we may safely use rsp instead to perform the stack watermark check. - cmpq(in_nmethod ? rsp : rbp, Address(thread_reg, Thread::polling_word_offset())); + cmpptr(in_nmethod ? rsp : rbp, Address(thread_reg, Thread::polling_word_offset())); jcc(Assembler::above, slow_path); return; } -#endif testb(Address(thread_reg, Thread::polling_word_offset()), SafepointMechanism::poll_bit()); jcc(Assembler::notZero, slow_path); // handshake bit set implies poll } @@ -3932,44 +3929,6 @@ void MacroAssembler::vallones(XMMRegister dst, int vector_len) { } } -RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset) { - intptr_t value = *delayed_value_addr; - if (value != 0) - return RegisterOrConstant(value + offset); - - // load indirectly to solve generation ordering problem - movptr(tmp, ExternalAddress((address) delayed_value_addr)); - -#ifdef ASSERT - { Label L; - testptr(tmp, tmp); - if (WizardMode) { - const char* buf = NULL; - { - ResourceMark rm; - stringStream ss; - ss.print("DelayedValue=" INTPTR_FORMAT, delayed_value_addr[1]); - buf = code_string(ss.as_string()); - } - jcc(Assembler::notZero, L); - STOP(buf); - } else { - jccb(Assembler::notZero, L); - hlt(); - } - bind(L); - } -#endif - - if (offset != 0) - addptr(tmp, offset); - - return RegisterOrConstant(tmp); -} - - Address MacroAssembler::argument_address(RegisterOrConstant arg_slot, int extra_slot_offset) { // cf. TemplateTable::prepare_invoke(), if (load_receiver). @@ -3991,7 +3950,6 @@ Address MacroAssembler::argument_address(RegisterOrConstant arg_slot, return Address(rsp, scale_reg, scale_factor, offset); } - void MacroAssembler::_verify_oop_addr(Address addr, const char* s, const char* file, int line) { if (!VerifyOops) return; diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index e1dafe95baca2..e7419fc916b8d 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -583,22 +583,30 @@ class MacroAssembler: public Assembler { // method handles (JSR 292) Address argument_address(RegisterOrConstant arg_slot, int extra_slot_offset = 0); - //---- - void set_word_if_not_zero(Register reg); // sets reg to 1 if not zero, otherwise 0 - // Debugging // only if +VerifyOops void _verify_oop(Register reg, const char* s, const char* file, int line); void _verify_oop_addr(Address addr, const char* s, const char* file, int line); + void _verify_oop_checked(Register reg, const char* s, const char* file, int line) { + if (VerifyOops) { + _verify_oop(reg, s, file, line); + } + } + void _verify_oop_addr_checked(Address reg, const char* s, const char* file, int line) { + if (VerifyOops) { + _verify_oop_addr(reg, s, file, line); + } + } + // TODO: verify method and klass metadata (compare against vptr?) void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {} void _verify_klass_ptr(Register reg, const char * msg, const char * file, int line){} -#define verify_oop(reg) _verify_oop(reg, "broken oop " #reg, __FILE__, __LINE__) -#define verify_oop_msg(reg, msg) _verify_oop(reg, "broken oop " #reg ", " #msg, __FILE__, __LINE__) -#define verify_oop_addr(addr) _verify_oop_addr(addr, "broken oop addr " #addr, __FILE__, __LINE__) +#define verify_oop(reg) _verify_oop_checked(reg, "broken oop " #reg, __FILE__, __LINE__) +#define verify_oop_msg(reg, msg) _verify_oop_checked(reg, "broken oop " #reg ", " #msg, __FILE__, __LINE__) +#define verify_oop_addr(addr) _verify_oop_addr_checked(addr, "broken oop addr " #addr, __FILE__, __LINE__) #define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__) #define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__) @@ -643,10 +651,6 @@ class MacroAssembler: public Assembler { // Check for reserved stack access in method being exited (for JIT) void reserved_stack_check(); - virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset); - void safepoint_poll(Label& slow_path, Register thread_reg, bool at_return, bool in_nmethod); void verify_tlab(); diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp index 4032ed6645476..b028e6a9c9bce 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp @@ -6851,7 +6851,9 @@ address generate_avx_ghash_processBlocks() { StubRoutines::x86::_vector_iota_indices = generate_iota_indices("iota_indices"); // support for verify_oop (must happen after universe_init) - StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop(); + if (VerifyOops) { + StubRoutines::_verify_oop_subroutine_entry = generate_verify_oop(); + } // data cache line writeback StubRoutines::_data_cache_writeback = generate_data_cache_writeback(); diff --git a/src/hotspot/cpu/x86/vm_version_x86.hpp b/src/hotspot/cpu/x86/vm_version_x86.hpp index 963e5bae26c92..5d91280e61615 100644 --- a/src/hotspot/cpu/x86/vm_version_x86.hpp +++ b/src/hotspot/cpu/x86/vm_version_x86.hpp @@ -1023,7 +1023,7 @@ enum Extended_Family { } constexpr static bool supports_stack_watermark_barrier() { - return LP64_ONLY(true) NOT_LP64(false); + return true; } // there are several insns to force cache line sync to memory which diff --git a/src/hotspot/cpu/x86/x86_32.ad b/src/hotspot/cpu/x86/x86_32.ad index cce4027e01615..130cdbed3e1c7 100644 --- a/src/hotspot/cpu/x86/x86_32.ad +++ b/src/hotspot/cpu/x86/x86_32.ad @@ -653,8 +653,9 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream* st ) const { } st->print_cr("POPL EBP"); st->print("\t"); if (do_polling() && C->is_method_compilation()) { - st->print("TEST PollPage,EAX\t! Poll Safepoint"); - st->cr(); st->print("\t"); + st->print("CMPL rsp, poll_offset[thread] \n\t" + "JA #safepoint_stub\t" + "# Safepoint: poll for GC"); } } #endif @@ -697,12 +698,16 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { } if (do_polling() && C->is_method_compilation()) { - Register pollReg = as_Register(EBX_enc); + Register thread = as_Register(EBX_enc); MacroAssembler masm(&cbuf); - masm.get_thread(pollReg); - masm.movl(pollReg, Address(pollReg, in_bytes(Thread::polling_page_offset()))); - masm.relocate(relocInfo::poll_return_type); - masm.testl(rax, Address(pollReg, 0)); + __ get_thread(thread); + Label dummy_label; + Label* code_stub = &dummy_label; + if (!C->output()->in_scratch_emit_size()) { + code_stub = &C->output()->safepoint_poll_table()->add_safepoint(__ offset()); + } + __ relocate(relocInfo::poll_return_type); + __ safepoint_poll(*code_stub, thread, true /* at_return */, true /* in_nmethod */); } } diff --git a/src/hotspot/cpu/x86/x86_64.ad b/src/hotspot/cpu/x86/x86_64.ad index dce6a24635e83..16cf230d602ba 100644 --- a/src/hotspot/cpu/x86/x86_64.ad +++ b/src/hotspot/cpu/x86/x86_64.ad @@ -930,8 +930,8 @@ void MachEpilogNode::format(PhaseRegAlloc* ra_, outputStream* st) const st->print_cr("popq rbp"); if (do_polling() && C->is_method_compilation()) { st->print("\t"); - st->print_cr("cmpq poll_offset[r15_thread], rsp\n\t" - "ja #safepoint_stub\t" + st->print_cr("cmpq rsp, poll_offset[r15_thread] \n\t" + "ja #safepoint_stub\t" "# Safepoint: poll for GC"); } } diff --git a/src/hotspot/cpu/zero/assembler_zero.cpp b/src/hotspot/cpu/zero/assembler_zero.cpp index b23048bb82b6c..706e020123a1c 100644 --- a/src/hotspot/cpu/zero/assembler_zero.cpp +++ b/src/hotspot/cpu/zero/assembler_zero.cpp @@ -66,12 +66,6 @@ void MacroAssembler::advance(int bytes) { code_section()->set_end(code_section()->end() + bytes); } -RegisterOrConstant MacroAssembler::delayed_value_impl( - intptr_t* delayed_value_addr, Register tmpl, int offset) { - ShouldNotCallThis(); - return RegisterOrConstant(); -} - void MacroAssembler::store_oop(jobject obj) { code_section()->relocate(pc(), oop_Relocation::spec_for_immediate()); emit_address((address) obj); diff --git a/src/hotspot/cpu/zero/assembler_zero.hpp b/src/hotspot/cpu/zero/assembler_zero.hpp index 1edf2c7df4912..ae4c58e8ac7f4 100644 --- a/src/hotspot/cpu/zero/assembler_zero.hpp +++ b/src/hotspot/cpu/zero/assembler_zero.hpp @@ -54,9 +54,6 @@ class MacroAssembler : public Assembler { void bang_stack_with_offset(int offset); bool needs_explicit_null_check(intptr_t offset); bool uses_implicit_null_check(void* address); - RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, int offset); - public: void advance(int bytes); void store_oop(jobject obj); void store_Metadata(Metadata* obj); diff --git a/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp b/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp index d20fe3e4f7fcb..f165de3a086af 100644 --- a/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp +++ b/src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp @@ -47,7 +47,6 @@ const char *BytecodeInterpreter::name_of_field_at_address(address addr) { DO(_constants); DO(_method); DO(_mirror); - DO(_mdx); DO(_stack); DO(_msg); DO(_result); @@ -84,7 +83,6 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate, istate->set_msg(BytecodeInterpreter::method_resume); istate->set_bcp_advance(0); istate->set_oop_temp(NULL); - istate->set_mdx(NULL); if (caller->is_interpreted_frame()) { interpreterState prev = caller->get_interpreterState(); prev->set_callee(method); diff --git a/src/hotspot/cpu/zero/frame_zero.inline.hpp b/src/hotspot/cpu/zero/frame_zero.inline.hpp index 11472461d642c..396e189a5db40 100644 --- a/src/hotspot/cpu/zero/frame_zero.inline.hpp +++ b/src/hotspot/cpu/zero/frame_zero.inline.hpp @@ -107,7 +107,8 @@ inline oop* frame::interpreter_frame_mirror_addr() const { } inline intptr_t* frame::interpreter_frame_mdp_addr() const { - return (intptr_t*) &(get_interpreterState()->_mdx); + fatal("Should not call this: Zero never profiles"); + return NULL; // silence compiler warnings } inline intptr_t* frame::interpreter_frame_tos_address() const { diff --git a/src/hotspot/cpu/zero/interp_masm_zero.hpp b/src/hotspot/cpu/zero/interp_masm_zero.hpp index 5d8aa9a3bdc29..a109b12dec0a2 100644 --- a/src/hotspot/cpu/zero/interp_masm_zero.hpp +++ b/src/hotspot/cpu/zero/interp_masm_zero.hpp @@ -35,14 +35,6 @@ class InterpreterMacroAssembler : public MacroAssembler { public: InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {} - - public: - RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, - Register tmp, - int offset) { - ShouldNotCallThis(); - return RegisterOrConstant(); - } }; #endif // CPU_ZERO_INTERP_MASM_ZERO_HPP diff --git a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp index 21a90d0752299..909f6caa266b4 100644 --- a/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp +++ b/src/hotspot/cpu/zero/zeroInterpreter_zero.cpp @@ -749,7 +749,6 @@ InterpreterFrame *InterpreterFrame::build(Method* const method, TRAPS) { istate->set_constants(method->constants()->cache()); istate->set_msg(BytecodeInterpreter::method_entry); istate->set_oop_temp(NULL); - istate->set_mdx(NULL); istate->set_callee(NULL); istate->set_monitor_base((BasicObjectLock *) stack->sp()); diff --git a/src/hotspot/os/aix/globals_aix.hpp b/src/hotspot/os/aix/globals_aix.hpp index b6b67a4f3bbf1..1203b09c883e1 100644 --- a/src/hotspot/os/aix/globals_aix.hpp +++ b/src/hotspot/os/aix/globals_aix.hpp @@ -88,7 +88,6 @@ // Use Use64KPages or Use16MPages instead. define_pd_global(bool, UseLargePages, false); define_pd_global(bool, UseLargePagesIndividualAllocation, false); -define_pd_global(bool, UseOSErrorReporting, false); define_pd_global(bool, UseThreadPriorities, true) ; #endif // OS_AIX_GLOBALS_AIX_HPP diff --git a/src/hotspot/os/bsd/globals_bsd.hpp b/src/hotspot/os/bsd/globals_bsd.hpp index 6c8939a6dc02b..b36173655df8a 100644 --- a/src/hotspot/os/bsd/globals_bsd.hpp +++ b/src/hotspot/os/bsd/globals_bsd.hpp @@ -44,7 +44,6 @@ // define_pd_global(bool, UseLargePages, false); define_pd_global(bool, UseLargePagesIndividualAllocation, false); -define_pd_global(bool, UseOSErrorReporting, false); define_pd_global(bool, UseThreadPriorities, true) ; #endif // OS_BSD_GLOBALS_BSD_HPP diff --git a/src/hotspot/os/linux/globals_linux.hpp b/src/hotspot/os/linux/globals_linux.hpp index 047901c6efae3..a37fd28f0e476 100644 --- a/src/hotspot/os/linux/globals_linux.hpp +++ b/src/hotspot/os/linux/globals_linux.hpp @@ -92,7 +92,6 @@ // define_pd_global(bool, UseLargePages, false); define_pd_global(bool, UseLargePagesIndividualAllocation, false); -define_pd_global(bool, UseOSErrorReporting, false); define_pd_global(bool, UseThreadPriorities, true) ; #endif // OS_LINUX_GLOBALS_LINUX_HPP diff --git a/src/hotspot/os/windows/globals_windows.hpp b/src/hotspot/os/windows/globals_windows.hpp index a712e102a760b..61157041f887b 100644 --- a/src/hotspot/os/windows/globals_windows.hpp +++ b/src/hotspot/os/windows/globals_windows.hpp @@ -28,24 +28,25 @@ // // Declare Windows specific flags. They are not available on other platforms. // -#define RUNTIME_OS_FLAGS(develop, \ - develop_pd, \ - product, \ - product_pd, \ - notproduct, \ - range, \ - constraint) +#define RUNTIME_OS_FLAGS(develop, \ + develop_pd, \ + product, \ + product_pd, \ + notproduct, \ + range, \ + constraint) \ + \ +product(bool, UseOSErrorReporting, false, \ + "Let VM fatal error propagate to the OS (ie. WER on Windows)") // end of RUNTIME_OS_FLAGS - // // Defines Windows-specific default values. The flags are available on all // platforms, but they may have different default values on other platforms. // define_pd_global(bool, UseLargePages, false); define_pd_global(bool, UseLargePagesIndividualAllocation, true); -define_pd_global(bool, UseOSErrorReporting, false); // for now. define_pd_global(bool, UseThreadPriorities, true) ; #endif // OS_WINDOWS_GLOBALS_WINDOWS_HPP diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 99ac2c074f3f2..88428ca5ce3c3 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -2354,7 +2354,7 @@ static inline void report_error(Thread* t, DWORD exception_code, address addr, void* siginfo, void* context) { VMError::report_and_die(t, exception_code, addr, siginfo, context); - // If UseOsErrorReporting, this will return here and save the error file + // If UseOSErrorReporting, this will return here and save the error file // somewhere where we can find it in the minidump. } diff --git a/src/hotspot/share/asm/assembler.hpp b/src/hotspot/share/asm/assembler.hpp index a4c5d7d455428..8f76130522ee8 100644 --- a/src/hotspot/share/asm/assembler.hpp +++ b/src/hotspot/share/asm/assembler.hpp @@ -431,22 +431,6 @@ class AbstractAssembler : public ResourceObj { return ptr; } - // Bootstrapping aid to cope with delayed determination of constants. - // Returns a static address which will eventually contain the constant. - // The value zero (NULL) stands instead of a constant which is still uncomputed. - // Thus, the eventual value of the constant must not be zero. - // This is fine, since this is designed for embedding object field - // offsets in code which must be generated before the object class is loaded. - // Field offsets are never zero, since an object's header (mark word) - // is located at offset zero. - RegisterOrConstant delayed_value(int(*value_fn)(), Register tmp, int offset = 0); - RegisterOrConstant delayed_value(address(*value_fn)(), Register tmp, int offset = 0); - virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset) = 0; - // Last overloading is platform-dependent; look in assembler_.cpp. - static intptr_t* delayed_value_addr(int(*constant_fn)()); - static intptr_t* delayed_value_addr(address(*constant_fn)()); - static void update_delayed_values(); - // Bang stack to trigger StackOverflowError at a safe location // implementation delegates to machine-specific bang_stack_with_offset void generate_stack_overflow_check( int frame_size_in_bytes ); diff --git a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp index b9fec53b08bea..552c6346741cc 100644 --- a/src/hotspot/share/ci/ciReplay.cpp +++ b/src/hotspot/share/ci/ciReplay.cpp @@ -494,7 +494,7 @@ class CompileReplay : public StackObj { return true; } - // compile inline ... + // compile inline ( )* void* process_inline(ciMethod* imethod, Method* m, int entry_bci, int comp_level, TRAPS) { _imethod = m; _iklass = imethod->holder(); @@ -524,7 +524,7 @@ class CompileReplay : public StackObj { return NULL; } - // compile inline ... + // compile inline ( )* void process_compile(TRAPS) { Method* method = parse_method(CHECK); if (had_error()) return; @@ -606,8 +606,6 @@ class CompileReplay : public StackObj { } // ciMethod - // - // void process_ciMethod(TRAPS) { Method* method = parse_method(CHECK); if (had_error()) return; @@ -619,7 +617,7 @@ class CompileReplay : public StackObj { rec->_instructions_size = parse_int("instructions_size"); } - // ciMethodData orig # # ... data # # ... oops # ... methods + // ciMethodData orig * data * oops ( )* methods ( )* void process_ciMethodData(TRAPS) { Method* method = parse_method(CHECK); if (had_error()) return; @@ -694,7 +692,7 @@ class CompileReplay : public StackObj { Klass* k = parse_klass(CHECK); } - // ciInstanceKlass tag # # # ... + // ciInstanceKlass tag* // // Load the klass 'name' and link or initialize it. Verify that the // constant pool is the same length as 'length' and make sure the @@ -789,10 +787,12 @@ class CompileReplay : public StackObj { } } + // staticfield + // // Initialize a class and fill in the value for a static field. // This is useful when the compile was dependent on the value of // static fields but it's impossible to properly rerun the static - // initiailizer. + // initializer. void process_staticfield(TRAPS) { InstanceKlass* k = (InstanceKlass *)parse_klass(CHECK); @@ -906,6 +906,7 @@ class CompileReplay : public StackObj { } #if INCLUDE_JVMTI + // JvmtiExport void process_JvmtiExport(TRAPS) { const char* field = parse_string(); bool value = parse_int("JvmtiExport flag") != 0; diff --git a/src/hotspot/share/classfile/classListParser.cpp b/src/hotspot/share/classfile/classListParser.cpp index 0f7b78de4d7a0..2cd89417fd35d 100644 --- a/src/hotspot/share/classfile/classListParser.cpp +++ b/src/hotspot/share/classfile/classListParser.cpp @@ -461,7 +461,6 @@ bool ClassListParser::is_matching_cp_entry(constantPoolHandle &pool, int cp_inde } void ClassListParser::resolve_indy(Symbol* class_name_symbol, TRAPS) { - Handle class_loader(THREAD, SystemDictionary::java_system_loader()); Handle protection_domain; Klass* klass = SystemDictionary::resolve_or_fail(class_name_symbol, class_loader, protection_domain, true, THREAD); // FIXME should really be just a lookup @@ -482,8 +481,8 @@ void ClassListParser::resolve_indy(Symbol* class_name_symbol, TRAPS) { BootstrapInfo bootstrap_specifier(pool, pool_index, indy_index); Handle bsm = bootstrap_specifier.resolve_bsm(THREAD); if (!SystemDictionaryShared::is_supported_invokedynamic(&bootstrap_specifier)) { - tty->print_cr("is_supported_invokedynamic check failed for cp_index %d", pool_index); - continue; + log_debug(cds, lambda)("is_supported_invokedynamic check failed for cp_index %d", pool_index); + continue; } if (is_matching_cp_entry(pool, pool_index, THREAD)) { found = true; diff --git a/src/hotspot/share/classfile/javaClasses.hpp b/src/hotspot/share/classfile/javaClasses.hpp index a6fc3ad2ff142..2ce053487ae7f 100644 --- a/src/hotspot/share/classfile/javaClasses.hpp +++ b/src/hotspot/share/classfile/javaClasses.hpp @@ -904,8 +904,9 @@ class java_lang_ref_Reference: AllStatic { public: // Accessors - static inline oop referent(oop ref); - static inline void set_referent(oop ref, oop value); + static inline oop weak_referent_no_keepalive(oop ref); + static inline oop phantom_referent_no_keepalive(oop ref); + static inline oop unknown_referent_no_keepalive(oop ref); static inline void set_referent_raw(oop ref, oop value); static inline HeapWord* referent_addr_raw(oop ref); static inline oop next(oop ref); diff --git a/src/hotspot/share/classfile/javaClasses.inline.hpp b/src/hotspot/share/classfile/javaClasses.inline.hpp index 3e880da8ae5ed..44d62dab5daca 100644 --- a/src/hotspot/share/classfile/javaClasses.inline.hpp +++ b/src/hotspot/share/classfile/javaClasses.inline.hpp @@ -100,12 +100,17 @@ bool java_lang_String::is_instance_inlined(oop obj) { } // Accessors -oop java_lang_ref_Reference::referent(oop ref) { - return ref->obj_field(_referent_offset); + +oop java_lang_ref_Reference::weak_referent_no_keepalive(oop ref) { + return ref->obj_field_access(_referent_offset); +} + +oop java_lang_ref_Reference::phantom_referent_no_keepalive(oop ref) { + return ref->obj_field_access(_referent_offset); } -void java_lang_ref_Reference::set_referent(oop ref, oop value) { - ref->obj_field_put(_referent_offset, value); +oop java_lang_ref_Reference::unknown_referent_no_keepalive(oop ref) { + return ref->obj_field_access(_referent_offset); } void java_lang_ref_Reference::set_referent_raw(oop ref, oop value) { diff --git a/src/hotspot/share/classfile/lambdaFormInvokers.cpp b/src/hotspot/share/classfile/lambdaFormInvokers.cpp index ca7dc211e32b8..5d3a031658294 100644 --- a/src/hotspot/share/classfile/lambdaFormInvokers.cpp +++ b/src/hotspot/share/classfile/lambdaFormInvokers.cpp @@ -147,5 +147,5 @@ void LambdaFormInvokers::reload_class(char* name, ClassFileStream& st, TRAPS) { // exclude the existing class from dump SystemDictionaryShared::set_excluded(InstanceKlass::cast(klass)); - log_info(cds)("Replaced class %s, old: %p new: %p", name, klass, result); + log_info(cds, lambda)("Replaced class %s, old: %p new: %p", name, klass, result); } diff --git a/src/hotspot/share/classfile/systemDictionaryShared.cpp b/src/hotspot/share/classfile/systemDictionaryShared.cpp index 2cd54604d5b88..3723680192745 100644 --- a/src/hotspot/share/classfile/systemDictionaryShared.cpp +++ b/src/hotspot/share/classfile/systemDictionaryShared.cpp @@ -40,6 +40,7 @@ #include "interpreter/bootstrapInfo.hpp" #include "jfr/jfrEvents.hpp" #include "logging/log.hpp" +#include "logging/logStream.hpp" #include "memory/allocation.hpp" #include "memory/archiveUtils.hpp" #include "memory/dynamicArchive.hpp" @@ -1924,26 +1925,28 @@ bool SystemDictionaryShared::check_linking_constraints(InstanceKlass* klass, TRA } bool SystemDictionaryShared::is_supported_invokedynamic(BootstrapInfo* bsi) { + LogTarget(Debug, cds, lambda) log; if (bsi->arg_values() == NULL || !bsi->arg_values()->is_objArray()) { - DEBUG_ONLY( - tty->print_cr("bsi check failed"); - tty->print_cr(" bsi->arg_values().not_null() %d", bsi->arg_values().not_null()); + if (log.is_enabled()) { + LogStream log_stream(log); + log.print("bsi check failed"); + log.print(" bsi->arg_values().not_null() %d", bsi->arg_values().not_null()); if (bsi->arg_values().not_null()) { - tty->print_cr(" bsi->arg_values()->is_objArray() %d", bsi->arg_values()->is_objArray()); - bsi->print(); + log.print(" bsi->arg_values()->is_objArray() %d", bsi->arg_values()->is_objArray()); + bsi->print_msg_on(&log_stream); } - ) + } return false; } Handle bsm = bsi->bsm(); if (bsm.is_null() || !java_lang_invoke_DirectMethodHandle::is_instance(bsm())) { - DEBUG_ONLY( - tty->print_cr("bsm check failed"); - tty->print_cr(" bsm.is_null() %d", bsm.is_null()); - tty->print_cr(" java_lang_invoke_DirectMethodHandle::is_instance(bsm()) %d", + if (log.is_enabled()) { + log.print("bsm check failed"); + log.print(" bsm.is_null() %d", bsm.is_null()); + log.print(" java_lang_invoke_DirectMethodHandle::is_instance(bsm()) %d", java_lang_invoke_DirectMethodHandle::is_instance(bsm())); - ) + } return false; } @@ -1954,13 +1957,13 @@ bool SystemDictionaryShared::is_supported_invokedynamic(BootstrapInfo* bsi) { method->signature()->equals("(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;")) { return true; } else { - DEBUG_ONLY( + if (log.is_enabled()) { ResourceMark rm; - tty->print_cr("method check failed"); - tty->print_cr(" klass_name() %s", method->klass_name()->as_C_string()); - tty->print_cr(" name() %s", method->name()->as_C_string()); - tty->print_cr(" signature() %s", method->signature()->as_C_string()); - ) + log.print("method check failed"); + log.print(" klass_name() %s", method->klass_name()->as_C_string()); + log.print(" name() %s", method->name()->as_C_string()); + log.print(" signature() %s", method->signature()->as_C_string()); + } } return false; diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp index d4400135b9266..3b77b9b49f96e 100644 --- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp @@ -2437,10 +2437,11 @@ void G1CollectedHeap::print_heap_regions() const { } void G1CollectedHeap::print_on(outputStream* st) const { + size_t heap_used = Heap_lock->owned_by_self() ? used() : used_unlocked(); st->print(" %-20s", "garbage-first heap"); if (_hrm != NULL) { st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", - capacity()/K, used_unlocked()/K); + capacity()/K, heap_used/K); st->print(" [" PTR_FORMAT ", " PTR_FORMAT ")", p2i(_hrm->reserved().start()), p2i(_hrm->reserved().end())); diff --git a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp index efa0fb91bbf7a..11a66dea93480 100644 --- a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp +++ b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp @@ -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 @@ -25,6 +25,7 @@ #ifndef SHARE_GC_G1_G1FULLGCMARKER_INLINE_HPP #define SHARE_GC_G1_G1FULLGCMARKER_INLINE_HPP +#include "classfile/javaClasses.inline.hpp" #include "gc/g1/g1Allocator.inline.hpp" #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp" #include "gc/g1/g1FullGCMarker.hpp" @@ -57,7 +58,8 @@ inline bool G1FullGCMarker::mark_object(oop obj) { } // Check if deduplicatable string. - if (G1StringDedup::is_enabled()) { + if (G1StringDedup::is_enabled() && + java_lang_String::is_instance_inlined(obj)) { G1StringDedup::enqueue_from_mark(obj, _worker_id); } return true; diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp index 40149f9133664..ad8f76e33a706 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/systemDictionary.hpp" #include "gc/g1/g1Allocator.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectionSet.hpp" @@ -75,10 +76,17 @@ G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, _old_gen_is_full(false), _partial_objarray_chunk_size(ParGCArrayScanChunk), _partial_array_stepper(n_workers), + _string_klass_or_null(G1StringDedup::is_enabled() + ? SystemDictionary::String_klass() + : nullptr), _num_optional_regions(optional_cset_length), _numa(g1h->numa()), _obj_alloc_stat(NULL) { + // Verify klass comparison with _string_klass_or_null is sufficient + // to determine whether dedup is enabled and the object is a String. + assert(SystemDictionary::String_klass()->is_final(), "precondition"); + // We allocate number of young gen regions in the collection set plus one // entries, since entry 0 keeps track of surviving bytes for non-young regions. // We also add a few elements at the beginning and at the end in @@ -510,7 +518,10 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio return obj; } - if (G1StringDedup::is_enabled()) { + // StringDedup::is_enabled() and java_lang_String::is_instance_inline + // test of the obj, combined into a single comparison, using the klass + // already in hand and avoiding the null check in is_instance. + if (klass == _string_klass_or_null) { const bool is_from_young = region_attr.is_young(); const bool is_to_young = dest_attr.is_young(); assert(is_from_young == from_region->is_young(), diff --git a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp index 0f6a4f211bca2..8b1c1b657001b 100644 --- a/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp +++ b/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp @@ -42,6 +42,7 @@ class G1OopStarChunkedList; class G1PLABAllocator; class G1EvacuationRootClosures; class HeapRegion; +class Klass; class outputStream; class G1ParScanThreadState : public CHeapObj { @@ -83,6 +84,8 @@ class G1ParScanThreadState : public CHeapObj { // Size (in elements) of a partial objArray task chunk. int _partial_objarray_chunk_size; PartialArrayTaskStepper _partial_array_stepper; + // Used to check whether string dedup should be applied to an object. + Klass* _string_klass_or_null; G1RedirtyCardsQueue& redirty_cards_queue() { return _rdcq; } G1CardTable* ct() { return _ct; } diff --git a/src/hotspot/share/gc/g1/g1StringDedup.cpp b/src/hotspot/share/gc/g1/g1StringDedup.cpp index 2da35163fad8d..122f1a7e9c7e8 100644 --- a/src/hotspot/share/gc/g1/g1StringDedup.cpp +++ b/src/hotspot/share/gc/g1/g1StringDedup.cpp @@ -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 @@ -41,29 +41,23 @@ void G1StringDedup::initialize() { } bool G1StringDedup::is_candidate_from_mark(oop obj) { - if (java_lang_String::is_instance_inlined(obj)) { - bool from_young = G1CollectedHeap::heap()->heap_region_containing(obj)->is_young(); - if (from_young && obj->age() < StringDeduplicationAgeThreshold) { - // Candidate found. String is being evacuated from young to old but has not - // reached the deduplication age threshold, i.e. has not previously been a - // candidate during its life in the young generation. - return true; - } - } - - // Not a candidate - return false; + bool from_young = G1CollectedHeap::heap()->heap_region_containing(obj)->is_young(); + // Candidate if string is being evacuated from young to old but has not + // reached the deduplication age threshold, i.e. has not previously been a + // candidate during its life in the young generation. + return from_young && (obj->age() < StringDeduplicationAgeThreshold); } void G1StringDedup::enqueue_from_mark(oop java_string, uint worker_id) { assert(is_enabled(), "String deduplication not enabled"); + assert(java_lang_String::is_instance(java_string), "not a String"); if (is_candidate_from_mark(java_string)) { G1StringDedupQueue::push(worker_id, java_string); } } bool G1StringDedup::is_candidate_from_evacuation(bool from_young, bool to_young, oop obj) { - if (from_young && java_lang_String::is_instance_inlined(obj)) { + if (from_young) { if (to_young && obj->age() == StringDeduplicationAgeThreshold) { // Candidate found. String is being evacuated from young to young and just // reached the deduplication age threshold. @@ -83,6 +77,7 @@ bool G1StringDedup::is_candidate_from_evacuation(bool from_young, bool to_young, void G1StringDedup::enqueue_from_evacuation(bool from_young, bool to_young, uint worker_id, oop java_string) { assert(is_enabled(), "String deduplication not enabled"); + assert(java_lang_String::is_instance(java_string), "not a String"); if (is_candidate_from_evacuation(from_young, to_young, java_string)) { G1StringDedupQueue::push(worker_id, java_string); } diff --git a/src/hotspot/share/gc/g1/g1StringDedup.hpp b/src/hotspot/share/gc/g1/g1StringDedup.hpp index 7c0d3e46eafe5..2f03a890ca692 100644 --- a/src/hotspot/share/gc/g1/g1StringDedup.hpp +++ b/src/hotspot/share/gc/g1/g1StringDedup.hpp @@ -65,8 +65,8 @@ class G1StringDedup : public StringDedup { // Candidate selection policies, returns true if the given object is // candidate for string deduplication. - static bool is_candidate_from_mark(oop obj); - static bool is_candidate_from_evacuation(bool from_young, bool to_young, oop obj); + static bool is_candidate_from_mark(oop java_string); + static bool is_candidate_from_evacuation(bool from_young, bool to_young, oop java_string); public: // Initialize string deduplication. @@ -75,6 +75,7 @@ class G1StringDedup : public StringDedup { // Enqueues a deduplication candidate for later processing by the deduplication // thread. Before enqueuing, these functions apply the appropriate candidate // selection policy to filters out non-candidates. + // Precondition for both is that java_string is a String. static void enqueue_from_mark(oop java_string, uint worker_id); static void enqueue_from_evacuation(bool from_young, bool to_young, unsigned int queue, oop java_string); diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp index fa8c431c5b8f7..4f3f41e5ccf58 100644 --- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp +++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp @@ -539,6 +539,71 @@ void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) { old_gen()->object_iterate(cl); } +// The HeapBlockClaimer is used during parallel iteration over the heap, +// allowing workers to claim heap areas ("blocks"), gaining exclusive rights to these. +// The eden and survivor spaces are treated as single blocks as it is hard to divide +// these spaces. +// The old space is divided into fixed-size blocks. +class HeapBlockClaimer : public StackObj { + size_t _claimed_index; + +public: + static const size_t InvalidIndex = SIZE_MAX; + static const size_t EdenIndex = 0; + static const size_t SurvivorIndex = 1; + static const size_t NumNonOldGenClaims = 2; + + HeapBlockClaimer() : _claimed_index(EdenIndex) { } + // Claim the block and get the block index. + size_t claim_and_get_block() { + size_t block_index; + block_index = Atomic::fetch_and_add(&_claimed_index, 1u); + + PSOldGen* old_gen = ParallelScavengeHeap::heap()->old_gen(); + size_t num_claims = old_gen->num_iterable_blocks() + NumNonOldGenClaims; + + return block_index < num_claims ? block_index : InvalidIndex; + } +}; + +void ParallelScavengeHeap::object_iterate_parallel(ObjectClosure* cl, + HeapBlockClaimer* claimer) { + size_t block_index = claimer->claim_and_get_block(); + // Iterate until all blocks are claimed + if (block_index == HeapBlockClaimer::EdenIndex) { + young_gen()->eden_space()->object_iterate(cl); + block_index = claimer->claim_and_get_block(); + } + if (block_index == HeapBlockClaimer::SurvivorIndex) { + young_gen()->from_space()->object_iterate(cl); + young_gen()->to_space()->object_iterate(cl); + block_index = claimer->claim_and_get_block(); + } + while (block_index != HeapBlockClaimer::InvalidIndex) { + old_gen()->object_iterate_block(cl, block_index - HeapBlockClaimer::NumNonOldGenClaims); + block_index = claimer->claim_and_get_block(); + } +} + +class PSScavengeParallelObjectIterator : public ParallelObjectIterator { +private: + ParallelScavengeHeap* _heap; + HeapBlockClaimer _claimer; + +public: + PSScavengeParallelObjectIterator() : + _heap(ParallelScavengeHeap::heap()), + _claimer() {} + + virtual void object_iterate(ObjectClosure* cl, uint worker_id) { + _heap->object_iterate_parallel(cl, &_claimer); + } +}; + +ParallelObjectIterator* ParallelScavengeHeap::parallel_object_iterator(uint thread_num) { + return new PSScavengeParallelObjectIterator(); +} + HeapWord* ParallelScavengeHeap::block_start(const void* addr) const { if (young_gen()->is_in_reserved(addr)) { assert(young_gen()->is_in(addr), diff --git a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp index ed72efea86669..77f9ce1dc43c3 100644 --- a/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp +++ b/src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp @@ -45,6 +45,7 @@ class AdjoiningGenerations; class GCHeapSummary; +class HeapBlockClaimer; class MemoryManager; class MemoryPool; class PSAdaptiveSizePolicy; @@ -207,6 +208,8 @@ class ParallelScavengeHeap : public CollectedHeap { size_t unsafe_max_tlab_alloc(Thread* thr) const; void object_iterate(ObjectClosure* cl); + void object_iterate_parallel(ObjectClosure* cl, HeapBlockClaimer* claimer); + virtual ParallelObjectIterator* parallel_object_iterator(uint thread_num); HeapWord* block_start(const void* addr) const; bool block_is_obj(const HeapWord* addr) const; diff --git a/src/hotspot/share/gc/parallel/psOldGen.cpp b/src/hotspot/share/gc/parallel/psOldGen.cpp index c5b5943968282..8506079d5f012 100644 --- a/src/hotspot/share/gc/parallel/psOldGen.cpp +++ b/src/hotspot/share/gc/parallel/psOldGen.cpp @@ -173,6 +173,38 @@ HeapWord* PSOldGen::allocate(size_t word_size) { return res; } +size_t PSOldGen::num_iterable_blocks() const { + return (object_space()->used_in_bytes() + IterateBlockSize - 1) / IterateBlockSize; +} + +void PSOldGen::object_iterate_block(ObjectClosure* cl, size_t block_index) { + size_t block_word_size = IterateBlockSize / HeapWordSize; + assert((block_word_size % (ObjectStartArray::block_size)) == 0, + "Block size not a multiple of start_array block"); + + MutableSpace *space = object_space(); + + HeapWord* begin = space->bottom() + block_index * block_word_size; + HeapWord* end = MIN2(space->top(), begin + block_word_size); + + if (!start_array()->object_starts_in_range(begin, end)) { + return; + } + + // Get object starting at or reaching into this block. + HeapWord* start = start_array()->object_start(begin); + if (start < begin) { + start += oop(start)->size(); + } + assert(start >= begin, + "Object address" PTR_FORMAT " must be larger or equal to block address at " PTR_FORMAT, + p2i(start), p2i(begin)); + // Iterate all objects until the end. + for (HeapWord* p = start; p < end; p += oop(p)->size()) { + cl->do_object(oop(p)); + } +} + HeapWord* PSOldGen::expand_and_allocate(size_t word_size) { expand(word_size*HeapWordSize); if (GCExpandToAllocateDelayMillis > 0) { diff --git a/src/hotspot/share/gc/parallel/psOldGen.hpp b/src/hotspot/share/gc/parallel/psOldGen.hpp index f7e43af064f1c..d882bab114b6b 100644 --- a/src/hotspot/share/gc/parallel/psOldGen.hpp +++ b/src/hotspot/share/gc/parallel/psOldGen.hpp @@ -52,6 +52,9 @@ class PSOldGen : public CHeapObj { const size_t _min_gen_size; const size_t _max_gen_size; + // Block size for parallel iteration + static const size_t IterateBlockSize = 1024 * 1024; + #ifdef ASSERT void assert_block_in_covered_region(MemRegion new_memregion) { // Explictly capture current covered_region in a local @@ -163,6 +166,14 @@ class PSOldGen : public CHeapObj { void oop_iterate(OopIterateClosure* cl) { object_space()->oop_iterate(cl); } void object_iterate(ObjectClosure* cl) { object_space()->object_iterate(cl); } + // Number of blocks to be iterated over in the used part of old gen. + size_t num_iterable_blocks() const; + // Iterate the objects starting in block block_index within [bottom, top) of the + // old gen. The object just reaching into this block is not iterated over. + // A block is an evenly sized non-overlapping part of the old gen of + // IterateBlockSize bytes. + void object_iterate_block(ObjectClosure* cl, size_t block_index); + // Debugging - do not use for time critical operations void print() const; virtual void print_on(outputStream* st) const; diff --git a/src/hotspot/share/gc/shared/referenceProcessor.cpp b/src/hotspot/share/gc/shared/referenceProcessor.cpp index 820839dae61a1..d634ffa9efd76 100644 --- a/src/hotspot/share/gc/shared/referenceProcessor.cpp +++ b/src/hotspot/share/gc/shared/referenceProcessor.cpp @@ -262,7 +262,7 @@ void DiscoveredListIterator::load_ptrs(DEBUG_ONLY(bool allow_null_referent)) { _next_discovered = discovered; _referent_addr = java_lang_ref_Reference::referent_addr_raw(_current_discovered); - _referent = java_lang_ref_Reference::referent(_current_discovered); + _referent = java_lang_ref_Reference::unknown_referent_no_keepalive(_current_discovered); assert(Universe::heap()->is_in_or_null(_referent), "Wrong oop found in java.lang.Reference object"); assert(allow_null_referent ? @@ -1058,7 +1058,7 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list, // cleared concurrently by mutators during (or after) discovery. void ReferenceProcessor::verify_referent(oop obj) { bool da = discovery_is_atomic(); - oop referent = java_lang_ref_Reference::referent(obj); + oop referent = java_lang_ref_Reference::unknown_referent_no_keepalive(obj); assert(da ? oopDesc::is_oop(referent) : oopDesc::is_oop_or_null(referent), "Bad referent " INTPTR_FORMAT " found in Reference " INTPTR_FORMAT " during %satomic discovery ", @@ -1119,7 +1119,8 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { // known to be strongly reachable. if (is_alive_non_header() != NULL) { verify_referent(obj); - if (is_alive_non_header()->do_object_b(java_lang_ref_Reference::referent(obj))) { + oop referent = java_lang_ref_Reference::unknown_referent_no_keepalive(obj); + if (is_alive_non_header()->do_object_b(referent)) { return false; // referent is reachable } } @@ -1169,7 +1170,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { // .. we are an atomic collector and referent is in our span if (is_subject_to_discovery(obj) || (discovery_is_atomic() && - is_subject_to_discovery(java_lang_ref_Reference::referent(obj)))) { + is_subject_to_discovery(java_lang_ref_Reference::unknown_referent_no_keepalive(obj)))) { } else { return false; } diff --git a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp index d449672a34d68..f0c034d14013c 100644 --- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp +++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp @@ -51,7 +51,9 @@ void ShenandoahLoadReferenceBarrierStub::emit_code(LIR_Assembler* ce) { ShenandoahBarrierSetC1::ShenandoahBarrierSetC1() : _pre_barrier_c1_runtime_code_blob(NULL), - _load_reference_barrier_rt_code_blob(NULL) {} + _load_reference_barrier_normal_rt_code_blob(NULL), + _load_reference_barrier_native_rt_code_blob(NULL), + _load_reference_barrier_weak_rt_code_blob(NULL) {} void ShenandoahBarrierSetC1::pre_barrier(LIRGenerator* gen, CodeEmitInfo* info, DecoratorSet decorators, LIR_Opr addr_opr, LIR_Opr pre_val) { // First we test whether marking is in progress. @@ -107,15 +109,15 @@ void ShenandoahBarrierSetC1::pre_barrier(LIRGenerator* gen, CodeEmitInfo* info, __ branch_destination(slow->continuation()); } -LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, bool is_native) { +LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, ShenandoahBarrierSet::AccessKind kind) { if (ShenandoahLoadRefBarrier) { - return load_reference_barrier_impl(gen, obj, addr, is_native); + return load_reference_barrier_impl(gen, obj, addr, kind); } else { return obj; } } -LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, bool is_native) { +LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, ShenandoahBarrierSet::AccessKind kind) { assert(ShenandoahLoadRefBarrier, "Should be enabled"); obj = ensure_in_register(gen, obj, T_OBJECT); @@ -148,7 +150,7 @@ LIR_Opr ShenandoahBarrierSetC1::load_reference_barrier_impl(LIRGenerator* gen, L } __ cmp(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0)); - CodeStub* slow = new ShenandoahLoadReferenceBarrierStub(obj, addr, result, tmp1, tmp2, is_native); + CodeStub* slow = new ShenandoahLoadReferenceBarrierStub(obj, addr, result, tmp1, tmp2, kind); __ branch(lir_cond_notEqual, slow); __ branch_destination(slow->continuation()); @@ -211,8 +213,8 @@ void ShenandoahBarrierSetC1::load_at_resolved(LIRAccess& access, LIR_Opr result) if (ShenandoahBarrierSet::need_load_reference_barrier(decorators, type)) { LIR_Opr tmp = gen->new_register(T_OBJECT); BarrierSetC1::load_at_resolved(access, tmp); - bool is_weak = ShenandoahBarrierSet::use_load_reference_barrier_weak(decorators, type); - tmp = load_reference_barrier(gen, tmp, access.resolved_addr(), is_weak); + ShenandoahBarrierSet::AccessKind kind = ShenandoahBarrierSet::access_kind(decorators, type); + tmp = load_reference_barrier(gen, tmp, access.resolved_addr(), kind); __ move(tmp, result); } else { BarrierSetC1::load_at_resolved(access, result); @@ -251,14 +253,14 @@ class C1ShenandoahPreBarrierCodeGenClosure : public StubAssemblerCodeGenClosure class C1ShenandoahLoadReferenceBarrierCodeGenClosure : public StubAssemblerCodeGenClosure { private: - const bool _is_weak; + const ShenandoahBarrierSet::AccessKind _kind; public: - C1ShenandoahLoadReferenceBarrierCodeGenClosure(bool is_weak) : _is_weak(is_weak) {} + C1ShenandoahLoadReferenceBarrierCodeGenClosure(ShenandoahBarrierSet::AccessKind kind) : _kind(kind) {} virtual OopMapSet* generate_code(StubAssembler* sasm) { ShenandoahBarrierSetAssembler* bs = (ShenandoahBarrierSetAssembler*)BarrierSet::barrier_set()->barrier_set_assembler(); - bs->generate_c1_load_reference_barrier_runtime_stub(sasm, _is_weak); + bs->generate_c1_load_reference_barrier_runtime_stub(sasm, _kind); return NULL; } }; @@ -269,14 +271,19 @@ void ShenandoahBarrierSetC1::generate_c1_runtime_stubs(BufferBlob* buffer_blob) "shenandoah_pre_barrier_slow", false, &pre_code_gen_cl); if (ShenandoahLoadRefBarrier) { - C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_code_gen_cl(false); - _load_reference_barrier_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1, + C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_code_gen_cl(ShenandoahBarrierSet::AccessKind::NORMAL); + _load_reference_barrier_normal_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1, "shenandoah_load_reference_barrier_slow", false, &lrb_code_gen_cl); - C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_weak_code_gen_cl(true); + C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_native_code_gen_cl(ShenandoahBarrierSet::AccessKind::NATIVE); + _load_reference_barrier_native_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1, + "shenandoah_load_reference_barrier_native_slow", + false, &lrb_native_code_gen_cl); + + C1ShenandoahLoadReferenceBarrierCodeGenClosure lrb_weak_code_gen_cl(ShenandoahBarrierSet::AccessKind::WEAK); _load_reference_barrier_weak_rt_code_blob = Runtime1::generate_blob(buffer_blob, -1, - "shenandoah_load_reference_barrier_weak_slow", - false, &lrb_weak_code_gen_cl); + "shenandoah_load_reference_barrier_weak_slow", + false, &lrb_weak_code_gen_cl); } } diff --git a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp index c3b6ba63c0f4f..eb65475e60915 100644 --- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp +++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp @@ -94,10 +94,10 @@ class ShenandoahLoadReferenceBarrierStub: public CodeStub { LIR_Opr _result; LIR_Opr _tmp1; LIR_Opr _tmp2; - bool _is_weak; + ShenandoahBarrierSet::AccessKind _kind; public: - ShenandoahLoadReferenceBarrierStub(LIR_Opr obj, LIR_Opr addr, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2, bool is_weak) : - _obj(obj), _addr(addr), _result(result), _tmp1(tmp1), _tmp2(tmp2), _is_weak(is_weak) + ShenandoahLoadReferenceBarrierStub(LIR_Opr obj, LIR_Opr addr, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2, ShenandoahBarrierSet::AccessKind kind) : + _obj(obj), _addr(addr), _result(result), _tmp1(tmp1), _tmp2(tmp2), _kind(kind) { assert(_obj->is_register(), "should be register"); assert(_addr->is_register(), "should be register"); @@ -111,7 +111,7 @@ class ShenandoahLoadReferenceBarrierStub: public CodeStub { LIR_Opr result() const { return _result; } LIR_Opr tmp1() const { return _tmp1; } LIR_Opr tmp2() const { return _tmp2; } - bool is_weak() const { return _is_weak; } + ShenandoahBarrierSet::AccessKind kind() const { return _kind; } virtual void emit_code(LIR_Assembler* e); virtual void visit(LIR_OpVisitState* visitor) { @@ -190,15 +190,16 @@ class LIR_OpShenandoahCompareAndSwap : public LIR_Op { class ShenandoahBarrierSetC1 : public BarrierSetC1 { private: CodeBlob* _pre_barrier_c1_runtime_code_blob; - CodeBlob* _load_reference_barrier_rt_code_blob; + CodeBlob* _load_reference_barrier_normal_rt_code_blob; + CodeBlob* _load_reference_barrier_native_rt_code_blob; CodeBlob* _load_reference_barrier_weak_rt_code_blob; void pre_barrier(LIRGenerator* gen, CodeEmitInfo* info, DecoratorSet decorators, LIR_Opr addr_opr, LIR_Opr pre_val); - LIR_Opr load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, bool is_native); + LIR_Opr load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, ShenandoahBarrierSet::AccessKind kind); LIR_Opr storeval_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, DecoratorSet decorators); - LIR_Opr load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, bool is_native); + LIR_Opr load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr, ShenandoahBarrierSet::AccessKind kind); LIR_Opr ensure_in_register(LIRGenerator* gen, LIR_Opr obj, BasicType type); @@ -210,9 +211,14 @@ class ShenandoahBarrierSetC1 : public BarrierSetC1 { return _pre_barrier_c1_runtime_code_blob; } - CodeBlob* load_reference_barrier_rt_code_blob() { - assert(_load_reference_barrier_rt_code_blob != NULL, ""); - return _load_reference_barrier_rt_code_blob; + CodeBlob* load_reference_barrier_normal_rt_code_blob() { + assert(_load_reference_barrier_normal_rt_code_blob != NULL, ""); + return _load_reference_barrier_normal_rt_code_blob; + } + + CodeBlob* load_reference_barrier_native_rt_code_blob() { + assert(_load_reference_barrier_native_rt_code_blob != NULL, ""); + return _load_reference_barrier_native_rt_code_blob; } CodeBlob* load_reference_barrier_weak_rt_code_blob() { diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp index 47effbc485634..d5ba63ce898b1 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp @@ -305,7 +305,8 @@ bool ShenandoahBarrierSetC2::is_shenandoah_lrb_call(Node* call) { address entry_point = call->as_CallLeaf()->entry_point(); return (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier)) || (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow)) || - (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)); + (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak)) || + (entry_point == CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow)); } bool ShenandoahBarrierSetC2::is_shenandoah_marking_if(PhaseTransform *phase, Node* n) { @@ -545,9 +546,8 @@ Node* ShenandoahBarrierSetC2::load_at_resolved(C2Access& access, const Type* val // 2: apply LRB if needed if (ShenandoahBarrierSet::need_load_reference_barrier(decorators, type)) { - load = new ShenandoahLoadReferenceBarrierNode(NULL, - load, - ShenandoahBarrierSet::use_load_reference_barrier_weak(decorators, type)); + ShenandoahBarrierSet::AccessKind kind = ShenandoahBarrierSet::access_kind(decorators, type); + load = new ShenandoahLoadReferenceBarrierNode(NULL, load, kind); if (access.is_parse_access()) { load = static_cast(access).kit()->gvn().transform(load); } else { @@ -644,7 +644,7 @@ Node* ShenandoahBarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess load_store = kit->gvn().transform(new DecodeNNode(load_store, load_store->get_ptr_type())); } #endif - load_store = kit->gvn().transform(new ShenandoahLoadReferenceBarrierNode(NULL, load_store, false)); + load_store = kit->gvn().transform(new ShenandoahLoadReferenceBarrierNode(NULL, load_store, ShenandoahBarrierSet::AccessKind::NORMAL)); return load_store; } return BarrierSetC2::atomic_cmpxchg_val_at_resolved(access, expected_val, new_val, value_type); @@ -712,7 +712,7 @@ Node* ShenandoahBarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& acces } Node* result = BarrierSetC2::atomic_xchg_at_resolved(access, val, value_type); if (access.is_oop()) { - result = kit->gvn().transform(new ShenandoahLoadReferenceBarrierNode(NULL, result, false)); + result = kit->gvn().transform(new ShenandoahLoadReferenceBarrierNode(NULL, result, ShenandoahBarrierSet::AccessKind::NORMAL)); shenandoah_write_barrier_pre(kit, false /* do_load */, NULL, NULL, max_juint, NULL, NULL, result /* pre_val */, T_OBJECT); @@ -1060,15 +1060,15 @@ Node* ShenandoahBarrierSetC2::ideal_node(PhaseGVN* phase, Node* n, bool can_resh Node* in1 = n->in(1); Node* in2 = n->in(2); - // If one input is NULL, then step over the barriers (except LRB native) on the other input + // If one input is NULL, then step over the barriers normal LRB barriers on the other input if (in1->bottom_type() == TypePtr::NULL_PTR && !((in2->Opcode() == Op_ShenandoahLoadReferenceBarrier) && - ((ShenandoahLoadReferenceBarrierNode*)in2)->is_weak())) { + ((ShenandoahLoadReferenceBarrierNode*)in2)->kind() != ShenandoahBarrierSet::AccessKind::NORMAL)) { in2 = step_over_gc_barrier(in2); } if (in2->bottom_type() == TypePtr::NULL_PTR && !((in1->Opcode() == Op_ShenandoahLoadReferenceBarrier) && - ((ShenandoahLoadReferenceBarrierNode*)in1)->is_weak())) { + ((ShenandoahLoadReferenceBarrierNode*)in1)->kind() != ShenandoahBarrierSet::AccessKind::NORMAL)) { in1 = step_over_gc_barrier(in1); } diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp index a228d0d82151b..5ea607ccb272a 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp @@ -956,7 +956,8 @@ void ShenandoahBarrierC2Support::test_in_cset(Node*& ctrl, Node*& not_cset_ctrl, phase->register_new_node(cset_bool, old_ctrl); } -void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, Node*& result_mem, Node* raw_mem, bool is_weak, PhaseIdealLoop* phase) { +void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, Node*& result_mem, Node* raw_mem, + ShenandoahBarrierSet::AccessKind kind, PhaseIdealLoop* phase) { IdealLoopTree*loop = phase->get_loop(ctrl); const TypePtr* obj_type = phase->igvn().type(val)->is_oopptr(); @@ -967,13 +968,28 @@ void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* lo mm->set_memory_at(Compile::AliasIdxRaw, raw_mem); phase->register_new_node(mm, ctrl); - address target = LP64_ONLY(UseCompressedOops) NOT_LP64(false) ? - CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow) : - CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier); - - address calladdr = is_weak ? CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak) - : target; - const char* name = is_weak ? "load_reference_barrier_native" : "load_reference_barrier"; + address calladdr = NULL; + const char* name = NULL; + switch (kind) { + case ShenandoahBarrierSet::AccessKind::NATIVE: + calladdr = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak); + name = "load_reference_barrier_native"; + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + calladdr = LP64_ONLY(UseCompressedOops) NOT_LP64(false) ? + CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak_narrow) : + CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_weak); + name = "load_reference_barrier_weak"; + break; + case ShenandoahBarrierSet::AccessKind::NORMAL: + calladdr = LP64_ONLY(UseCompressedOops) NOT_LP64(false) ? + CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_narrow) : + CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier); + name = "load_reference_barrier"; + break; + default: + ShouldNotReachHere(); + } Node* call = new CallLeafNode(ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type(), calladdr, name, TypeRawPtr::BOTTOM); call->init_req(TypeFunc::Control, ctrl); @@ -1338,7 +1354,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { // even for non-cset objects to prevent ressurrection of such objects. // Wires !in_cset(obj) to slot 2 of region and phis Node* not_cset_ctrl = NULL; - if (!lrb->is_weak()) { + if (lrb->kind() == ShenandoahBarrierSet::AccessKind::NORMAL) { test_in_cset(ctrl, not_cset_ctrl, val, raw_mem, phase); } if (not_cset_ctrl != NULL) { @@ -1389,7 +1405,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) { } } } - call_lrb_stub(ctrl, val, addr, result_mem, raw_mem, lrb->is_weak(), phase); + call_lrb_stub(ctrl, val, addr, result_mem, raw_mem, lrb->kind(), phase); region->init_req(_evac_path, ctrl); val_phi->init_req(_evac_path, val); raw_mem_phi->init_req(_evac_path, result_mem); @@ -2361,7 +2377,7 @@ void MemoryGraphFixer::collect_memory_nodes() { while (dead_phis.size() > 0) { Node* n = dead_phis.pop(); n->replace_by(_phase->C->top()); - n->destruct(); + n->destruct(&_phase->igvn()); } for (int i = rpo_list.size() - 1; i >= 0; i--) { Node* c = rpo_list.at(i); @@ -2885,13 +2901,13 @@ void MemoryGraphFixer::fix_memory_uses(Node* mem, Node* replacement, Node* rep_p } } -ShenandoahLoadReferenceBarrierNode::ShenandoahLoadReferenceBarrierNode(Node* ctrl, Node* obj, bool weak) -: Node(ctrl, obj), _weak(weak) { +ShenandoahLoadReferenceBarrierNode::ShenandoahLoadReferenceBarrierNode(Node* ctrl, Node* obj, ShenandoahBarrierSet::AccessKind kind) +: Node(ctrl, obj), _kind(kind) { ShenandoahBarrierSetC2::bsc2()->state()->add_load_reference_barrier(this); } -bool ShenandoahLoadReferenceBarrierNode::is_weak() const { - return _weak; +ShenandoahBarrierSet::AccessKind ShenandoahLoadReferenceBarrierNode::kind() const { + return _kind; } uint ShenandoahLoadReferenceBarrierNode::size_of() const { @@ -2899,12 +2915,26 @@ uint ShenandoahLoadReferenceBarrierNode::size_of() const { } uint ShenandoahLoadReferenceBarrierNode::hash() const { - return Node::hash() + (_weak ? 1 : 0); + uint hash = Node::hash(); + switch (_kind) { + case ShenandoahBarrierSet::AccessKind::NORMAL: + hash += 0; + break; + case ShenandoahBarrierSet::AccessKind::WEAK: + hash += 1; + break; + case ShenandoahBarrierSet::AccessKind::NATIVE: + hash += 2; + break; + default: + ShouldNotReachHere(); + } + return hash; } bool ShenandoahLoadReferenceBarrierNode::cmp( const Node &n ) const { return Node::cmp(n) && n.Opcode() == Op_ShenandoahLoadReferenceBarrier && - _weak == ((const ShenandoahLoadReferenceBarrierNode&)n)._weak; + _kind == ((const ShenandoahLoadReferenceBarrierNode&)n)._kind; } const Type* ShenandoahLoadReferenceBarrierNode::bottom_type() const { diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp index 715eefd1cbcd1..c07b4a1ed72a9 100644 --- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp @@ -25,6 +25,7 @@ #ifndef SHARE_GC_SHENANDOAH_C2_SHENANDOAHSUPPORT_HPP #define SHARE_GC_SHENANDOAH_C2_SHENANDOAHSUPPORT_HPP +#include "gc/shenandoah/shenandoahBarrierSet.hpp" #include "memory/allocation.hpp" #include "opto/addnode.hpp" #include "opto/graphKit.hpp" @@ -60,7 +61,8 @@ class ShenandoahBarrierC2Support : public AllStatic { static void test_null(Node*& ctrl, Node* val, Node*& null_ctrl, PhaseIdealLoop* phase); static void test_gc_state(Node*& ctrl, Node* raw_mem, Node*& heap_stable_ctrl, PhaseIdealLoop* phase, int flags); - static void call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, Node*& result_mem, Node* raw_mem, bool is_weak, PhaseIdealLoop* phase); + static void call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, Node*& result_mem, Node* raw_mem, + ShenandoahBarrierSet::AccessKind kind, PhaseIdealLoop* phase); static void test_in_cset(Node*& ctrl, Node*& not_cset_ctrl, Node* val, Node* raw_mem, PhaseIdealLoop* phase); static void move_gc_state_test_out_of_loop(IfNode* iff, PhaseIdealLoop* phase); static void merge_back_to_back_tests(Node* n, PhaseIdealLoop* phase); @@ -229,12 +231,12 @@ class ShenandoahLoadReferenceBarrierNode : public Node { }; private: - bool _weak; + ShenandoahBarrierSet::AccessKind _kind; public: - ShenandoahLoadReferenceBarrierNode(Node* ctrl, Node* val, bool native); + ShenandoahLoadReferenceBarrierNode(Node* ctrl, Node* val, ShenandoahBarrierSet::AccessKind kind); - bool is_weak() const; + ShenandoahBarrierSet::AccessKind kind() const; virtual int Opcode() const; virtual const Type* bottom_type() const; virtual const Type* Value(PhaseGVN* phase) const; diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp index 72eba58baa3b0..dccc0e9e6b58d 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.cpp @@ -61,12 +61,6 @@ bool ShenandoahAggressiveHeuristics::should_start_gc() const { return true; } -bool ShenandoahAggressiveHeuristics::should_process_references() { - if (!can_process_references()) return false; - // Randomly process refs with 50% chance. - return (os::random() & 1) == 1; -} - bool ShenandoahAggressiveHeuristics::should_unload_classes() { if (!can_unload_classes_normal()) return false; if (has_metaspace_oom()) return true; diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.hpp index 071b3be8ff6d5..46956e40ca9e2 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.hpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAggressiveHeuristics.hpp @@ -37,8 +37,6 @@ class ShenandoahAggressiveHeuristics : public ShenandoahHeuristics { virtual bool should_start_gc() const; - virtual bool should_process_references(); - virtual bool should_unload_classes(); virtual const char* name() { return "Aggressive"; } diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp index 4ce2366fe0c5f..7027082cbc152 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.cpp @@ -257,18 +257,6 @@ void ShenandoahHeuristics::record_requested_gc() { _gc_times_learned = 0; } -bool ShenandoahHeuristics::can_process_references() { - if (ShenandoahRefProcFrequency == 0) return false; - return true; -} - -bool ShenandoahHeuristics::should_process_references() { - if (!can_process_references()) return false; - size_t cycle = ShenandoahHeap::heap()->shenandoah_policy()->cycle_counter(); - // Process references every Nth GC cycle. - return cycle % ShenandoahRefProcFrequency == 0; -} - bool ShenandoahHeuristics::can_unload_classes() { if (!ClassUnloading) return false; return true; diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp index 573b2585ce0b4..fed9296d66766 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahHeuristics.hpp @@ -120,9 +120,6 @@ class ShenandoahHeuristics : public CHeapObj { virtual void choose_collection_set(ShenandoahCollectionSet* collection_set); - virtual bool can_process_references(); - virtual bool should_process_references(); - virtual bool can_unload_classes(); virtual bool can_unload_classes_normal(); virtual bool should_unload_classes(); diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp index d8027af71054b..e13f932189885 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.cpp @@ -36,11 +36,6 @@ bool ShenandoahPassiveHeuristics::should_start_gc() const { return false; } -bool ShenandoahPassiveHeuristics::should_process_references() { - // Always process references, if we can. - return can_process_references(); -} - bool ShenandoahPassiveHeuristics::should_unload_classes() { // Always unload classes, if we can. return can_unload_classes(); diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.hpp index 752b0be4dcd91..1f259549fdc23 100644 --- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.hpp +++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahPassiveHeuristics.hpp @@ -31,8 +31,6 @@ class ShenandoahPassiveHeuristics : public ShenandoahHeuristics { public: virtual bool should_start_gc() const; - virtual bool should_process_references(); - virtual bool should_unload_classes(); virtual bool should_degenerate_cycle(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp index f7b9609eafd3f..27c1f988833ab 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp @@ -68,7 +68,8 @@ void ShenandoahAsserts::print_obj(ShenandoahMessageBuffer& msg, oop obj) { msg.append(" " PTR_FORMAT " - klass " PTR_FORMAT " %s\n", p2i(obj), p2i(obj->klass()), obj->klass()->external_name()); msg.append(" %3s allocated after mark start\n", ctx->allocated_after_mark_start(obj) ? "" : "not"); msg.append(" %3s after update watermark\n", cast_from_oop(obj) >= r->get_update_watermark() ? "" : "not"); - msg.append(" %3s marked \n", ctx->is_marked(obj) ? "" : "not"); + msg.append(" %3s marked strong\n", ctx->is_marked_strong(obj) ? "" : "not"); + msg.append(" %3s marked weak\n", ctx->is_marked_weak(obj) ? "" : "not"); msg.append(" %3s in collection set\n", heap->in_collection_set(obj) ? "" : "not"); msg.append(" mark:%s\n", mw_ss.as_string()); msg.append(" region: %s", ss.as_string()); @@ -353,24 +354,6 @@ void ShenandoahAsserts::print_rp_failure(const char *label, BoolObjectClosure* a report_vm_error(file, line, msg.buffer()); } -void ShenandoahAsserts::assert_rp_isalive_not_installed(const char *file, int line) { - ShenandoahHeap* heap = ShenandoahHeap::heap(); - ReferenceProcessor* rp = heap->ref_processor(); - if (rp->is_alive_non_header() != NULL) { - print_rp_failure("Shenandoah assert_rp_isalive_not_installed failed", rp->is_alive_non_header(), - file, line); - } -} - -void ShenandoahAsserts::assert_rp_isalive_installed(const char *file, int line) { - ShenandoahHeap* heap = ShenandoahHeap::heap(); - ReferenceProcessor* rp = heap->ref_processor(); - if (rp->is_alive_non_header() == NULL) { - print_rp_failure("Shenandoah assert_rp_isalive_installed failed", rp->is_alive_non_header(), - file, line); - } -} - void ShenandoahAsserts::assert_locked_or_shenandoah_safepoint(Mutex* lock, const char* file, int line) { if (ShenandoahSafepoint::is_at_shenandoah_safepoint()) { return; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp index 6fd890edb63d4..61779b447d6e9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp @@ -65,9 +65,6 @@ class ShenandoahAsserts { static void assert_not_in_cset(void* interior_loc, oop obj, const char* file, int line); static void assert_not_in_cset_loc(void* interior_loc, const char* file, int line); - static void assert_rp_isalive_not_installed(const char *file, int line); - static void assert_rp_isalive_installed(const char *file, int line); - static void assert_locked_or_shenandoah_safepoint(Mutex* lock, const char* file, int line); static void assert_heaplocked(const char* file, int line); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp index cb23dd7e86a35..adf349d3b24c8 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp @@ -87,17 +87,6 @@ bool ShenandoahBarrierSet::need_load_reference_barrier(DecoratorSet decorators, return is_reference_type(type); } -bool ShenandoahBarrierSet::use_load_reference_barrier_weak(DecoratorSet decorators, BasicType type) { - assert(need_load_reference_barrier(decorators, type), "Should be subset of LRB"); - assert(is_reference_type(type), "Why we here?"); - // Native load reference barrier is only needed for concurrent root processing - if (!ShenandoahConcurrentRoots::can_do_concurrent_roots()) { - return false; - } - - return ((decorators & IN_NATIVE) != 0) && ((decorators & ON_STRONG_OOP_REF) == 0); -} - bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,BasicType type) { if (!ShenandoahSATBBarrier) return false; // Only needed for references @@ -109,6 +98,16 @@ bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,Basic return (on_weak_ref || unknown) && keep_alive; } +ShenandoahBarrierSet::AccessKind ShenandoahBarrierSet::access_kind(DecoratorSet decorators, BasicType type) { + if ((decorators & IN_NATIVE) != 0) { + return AccessKind::NATIVE; + } else if ((decorators & (ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF | ON_UNKNOWN_OOP_REF)) != 0) { + return AccessKind::WEAK; + } else { + return AccessKind::NORMAL; + } +} + void ShenandoahBarrierSet::on_thread_create(Thread* thread) { // Create thread local data ShenandoahThreadLocalData::create(thread); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp index 391000cd3df2d..eee66c0c05dc4 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp @@ -33,8 +33,19 @@ class ShenandoahBarrierSetAssembler; class ShenandoahBarrierSet: public BarrierSet { -private: +public: + enum class AccessKind { + // Regular in-heap access on reference fields + NORMAL, + + // Off-heap reference access + NATIVE, + // In-heap reference access on referent fields of j.l.r.Reference objects + WEAK + }; + +private: ShenandoahHeap* _heap; BufferNode::Allocator _satb_mark_queue_buffer_allocator; ShenandoahSATBMarkQueueSet _satb_mark_queue_set; @@ -53,8 +64,8 @@ class ShenandoahBarrierSet: public BarrierSet { } static bool need_load_reference_barrier(DecoratorSet decorators, BasicType type); - static bool use_load_reference_barrier_weak(DecoratorSet decorators, BasicType type); static bool need_keep_alive_barrier(DecoratorSet decorators, BasicType type); + static AccessKind access_kind(DecoratorSet decorators, BasicType type); void print_on(outputStream* st) const; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp index a392915bc5b86..861ca705754e8 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp @@ -198,7 +198,7 @@ template inline oop ShenandoahBarrierSet::AccessBarrier::oop_load_in_heap(T* addr) { oop value = Raw::oop_load_in_heap(addr); ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set(); - value = bs->load_reference_barrier(value); + value = bs->load_reference_barrier(value, addr); bs->keep_alive_if_weak(value); return value; } @@ -207,9 +207,9 @@ template inline oop ShenandoahBarrierSet::AccessBarrier::oop_load_in_heap_at(oop base, ptrdiff_t offset) { oop value = Raw::oop_load_in_heap_at(base, offset); ShenandoahBarrierSet *const bs = ShenandoahBarrierSet::barrier_set(); - value = bs->load_reference_barrier(value); - bs->keep_alive_if_weak(AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength(base, offset), - value); + DecoratorSet resolved_decorators = AccessBarrierSupport::resolve_possibly_unknown_oop_ref_strength(base, offset); + value = bs->load_reference_barrier(value, AccessInternal::oop_field_addr(base, offset)); + bs->keep_alive_if_weak(resolved_decorators, value); return value; } @@ -217,6 +217,7 @@ template template inline void ShenandoahBarrierSet::AccessBarrier::oop_store_not_in_heap(T* addr, oop value) { shenandoah_assert_marked_if(NULL, value, !CompressedOops::is_null(value) && ShenandoahHeap::heap()->is_evacuation_in_progress()); + shenandoah_assert_not_in_cset_if(addr, value, value != NULL && !ShenandoahHeap::heap()->cancelled_gc()); ShenandoahBarrierSet* const bs = ShenandoahBarrierSet::barrier_set(); bs->storeval_barrier(value); bs->satb_barrier(addr); @@ -339,7 +340,7 @@ void ShenandoahBarrierSet::arraycopy_work(T* src, size_t count) { oop witness = ShenandoahHeap::cas_oop(fwd, elem_ptr, o); obj = fwd; } - if (ENQUEUE && !ctx->is_marked(obj)) { + if (ENQUEUE && !ctx->is_marked_strong(obj)) { queue.enqueue_known_active(obj); } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp index 815fde581b44c..5331ca26d4859 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.cpp @@ -31,8 +31,6 @@ #include "gc/shared/weakProcessor.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/referenceProcessor.hpp" -#include "gc/shared/referenceProcessorPhaseTimes.hpp" #include "gc/shared/strongRootsScope.hpp" #include "gc/shenandoah/shenandoahBarrierSet.inline.hpp" @@ -40,6 +38,7 @@ #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp" #include "gc/shenandoah/shenandoahMarkCompact.hpp" #include "gc/shenandoah/shenandoahHeap.inline.hpp" +#include "gc/shenandoah/shenandoahReferenceProcessor.hpp" #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp" #include "gc/shenandoah/shenandoahOopClosures.inline.hpp" #include "gc/shenandoah/shenandoahPhaseTimings.hpp" @@ -61,7 +60,7 @@ class ShenandoahInitMarkRootsClosure : public OopClosure { template inline void do_oop_work(T* p) { - ShenandoahConcurrentMark::mark_through_ref(p, _heap, _queue, _mark_context); + ShenandoahConcurrentMark::mark_through_ref(p, _heap, _queue, _mark_context, false); } public: @@ -74,11 +73,12 @@ class ShenandoahInitMarkRootsClosure : public OopClosure { void do_oop(oop* p) { do_oop_work(p); } }; -ShenandoahMarkRefsSuperClosure::ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : +ShenandoahMarkRefsSuperClosure::ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : MetadataVisitingOopIterateClosure(rp), _queue(q), _heap(ShenandoahHeap::heap()), - _mark_context(_heap->marking_context()) + _mark_context(_heap->marking_context()), + _weak(false) { } template @@ -153,14 +153,8 @@ class ShenandoahConcurrentMarkingTask : public AbstractGangTask { ShenandoahConcurrentWorkerSession worker_session(worker_id); ShenandoahSuspendibleThreadSetJoiner stsj(ShenandoahSuspendibleWorkers); ShenandoahObjToScanQueue* q = _cm->get_queue(worker_id); - ReferenceProcessor* rp; - if (heap->process_references()) { - rp = heap->ref_processor(); - shenandoah_assert_rp_isalive_installed(); - } else { - rp = NULL; - } - + ShenandoahReferenceProcessor* rp = heap->ref_processor(); + assert(rp != NULL, "need reference processor"); _cm->mark_loop(worker_id, _terminator, rp, true, // cancellable ShenandoahStringDedup::is_enabled()); // perform string dedup @@ -206,7 +200,7 @@ class ShenandoahProcessConcurrentRootsTask : public AbstractGangTask { private: ShenandoahConcurrentRootScanner _rs; ShenandoahConcurrentMark* const _cm; - ReferenceProcessor* _rp; + ShenandoahReferenceProcessor* _rp; public: ShenandoahProcessConcurrentRootsTask(ShenandoahConcurrentMark* cm, @@ -222,12 +216,7 @@ ShenandoahProcessConcurrentRootsTask::ShenandoahProcessConcurrentRootsTask(Sh AbstractGangTask("Shenandoah Process Concurrent Roots"), _rs(nworkers, phase), _cm(cm), - _rp(NULL) { - ShenandoahHeap* heap = ShenandoahHeap::heap(); - if (heap->process_references()) { - _rp = heap->ref_processor(); - shenandoah_assert_rp_isalive_installed(); - } + _rp(ShenandoahHeap::heap()->ref_processor()) { } template @@ -253,13 +242,7 @@ class ShenandoahFinalMarkingTask : public AbstractGangTask { ShenandoahHeap* heap = ShenandoahHeap::heap(); ShenandoahParallelWorkerSession worker_session(worker_id); - ReferenceProcessor* rp; - if (heap->process_references()) { - rp = heap->ref_processor(); - shenandoah_assert_rp_isalive_installed(); - } else { - rp = NULL; - } + ShenandoahReferenceProcessor* rp = heap->ref_processor(); // First drain remaining SATB buffers. // Notice that this is not strictly necessary for mark-compact. But since @@ -303,9 +286,12 @@ void ShenandoahConcurrentMark::mark_roots(ShenandoahPhaseTimings::Phase root_pha assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); ShenandoahHeap* heap = ShenandoahHeap::heap(); - ShenandoahGCPhase phase(root_phase); + ShenandoahReferenceProcessor* ref_processor = heap->ref_processor(); + ref_processor->reset_thread_locals(); + ref_processor->set_soft_reference_policy(_heap->soft_ref_policy()->should_clear_all_soft_refs()); + WorkGang* workers = heap->workers(); uint nworkers = workers->active_workers(); @@ -407,21 +393,21 @@ void ShenandoahConcurrentMark::initialize(uint workers) { // Mark concurrent roots during concurrent phases class ShenandoahMarkConcurrentRootsTask : public AbstractGangTask { private: - SuspendibleThreadSetJoiner _sts_joiner; + SuspendibleThreadSetJoiner _sts_joiner; ShenandoahConcurrentRootScanner _rs; - ShenandoahObjToScanQueueSet* const _queue_set; - ReferenceProcessor* const _rp; + ShenandoahObjToScanQueueSet* const _queue_set; + ShenandoahReferenceProcessor* const _rp; public: ShenandoahMarkConcurrentRootsTask(ShenandoahObjToScanQueueSet* qs, - ReferenceProcessor* rp, + ShenandoahReferenceProcessor* rp, ShenandoahPhaseTimings::Phase phase, uint nworkers); void work(uint worker_id); }; ShenandoahMarkConcurrentRootsTask::ShenandoahMarkConcurrentRootsTask(ShenandoahObjToScanQueueSet* qs, - ReferenceProcessor* rp, + ShenandoahReferenceProcessor* rp, ShenandoahPhaseTimings::Phase phase, uint nworkers) : AbstractGangTask("Shenandoah Concurrent Mark Roots"), @@ -442,19 +428,7 @@ void ShenandoahConcurrentMark::mark_from_roots() { WorkGang* workers = _heap->workers(); uint nworkers = workers->active_workers(); - ReferenceProcessor* rp = NULL; - if (_heap->process_references()) { - rp = _heap->ref_processor(); - rp->set_active_mt_degree(nworkers); - - // enable ("weak") refs discovery - rp->enable_discovery(true /*verify_no_refs*/); - rp->setup_policy(_heap->soft_ref_policy()->should_clear_all_soft_refs()); - } - - shenandoah_assert_rp_isalive_not_installed(); - ShenandoahIsAliveSelector is_alive; - ReferenceProcessorIsAliveMutator fix_isalive(_heap->ref_processor(), is_alive.is_alive_closure()); + ShenandoahReferenceProcessor* rp = _heap->ref_processor(); task_queues()->reserve(nworkers); @@ -480,10 +454,6 @@ void ShenandoahConcurrentMark::finish_mark_from_roots(bool full_gc) { uint nworkers = _heap->workers()->active_workers(); { - shenandoah_assert_rp_isalive_not_installed(); - ShenandoahIsAliveSelector is_alive; - ReferenceProcessorIsAliveMutator fix_isalive(_heap->ref_processor(), is_alive.is_alive_closure()); - // Full GC does not execute concurrent cycle. Degenerated cycle may bypass concurrent cycle. // In those cases, concurrent roots might not be scanned, scan them here. Ideally, this // should piggyback to ShenandoahFinalMarkingTask, but it makes time tracking very hard. @@ -524,343 +494,11 @@ void ShenandoahConcurrentMark::finish_mark_from_roots(bool full_gc) { assert(task_queues()->is_empty(), "Should be empty"); } - // When we're done marking everything, we process weak references. - if (_heap->process_references()) { - weak_refs_work(full_gc); - } - assert(task_queues()->is_empty(), "Should be empty"); TASKQUEUE_STATS_ONLY(task_queues()->print_taskqueue_stats()); TASKQUEUE_STATS_ONLY(task_queues()->reset_taskqueue_stats()); } -// Weak Reference Closures -class ShenandoahCMDrainMarkingStackClosure: public VoidClosure { - uint _worker_id; - TaskTerminator* _terminator; - bool _reset_terminator; - -public: - ShenandoahCMDrainMarkingStackClosure(uint worker_id, TaskTerminator* t, bool reset_terminator = false): - _worker_id(worker_id), - _terminator(t), - _reset_terminator(reset_terminator) { - } - - void do_void() { - assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); - - ShenandoahHeap* sh = ShenandoahHeap::heap(); - ShenandoahConcurrentMark* scm = sh->concurrent_mark(); - assert(sh->process_references(), "why else would we be here?"); - ReferenceProcessor* rp = sh->ref_processor(); - - shenandoah_assert_rp_isalive_installed(); - - scm->mark_loop(_worker_id, _terminator, rp, - false, // not cancellable - false); // do not do strdedup - - if (_reset_terminator) { - _terminator->reset_for_reuse(); - } - } -}; - -class ShenandoahCMKeepAliveClosure : public OopClosure { -private: - ShenandoahObjToScanQueue* _queue; - ShenandoahHeap* _heap; - ShenandoahMarkingContext* const _mark_context; - - template - inline void do_oop_work(T* p) { - ShenandoahConcurrentMark::mark_through_ref(p, _heap, _queue, _mark_context); - } - -public: - ShenandoahCMKeepAliveClosure(ShenandoahObjToScanQueue* q) : - _queue(q), - _heap(ShenandoahHeap::heap()), - _mark_context(_heap->marking_context()) {} - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop(oop* p) { do_oop_work(p); } -}; - -class ShenandoahCMKeepAliveUpdateClosure : public OopClosure { -private: - ShenandoahObjToScanQueue* _queue; - ShenandoahHeap* _heap; - ShenandoahMarkingContext* const _mark_context; - - template - inline void do_oop_work(T* p) { - ShenandoahConcurrentMark::mark_through_ref(p, _heap, _queue, _mark_context); - } - -public: - ShenandoahCMKeepAliveUpdateClosure(ShenandoahObjToScanQueue* q) : - _queue(q), - _heap(ShenandoahHeap::heap()), - _mark_context(_heap->marking_context()) {} - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop(oop* p) { do_oop_work(p); } -}; - -class ShenandoahWeakUpdateClosure : public OopClosure { -private: - ShenandoahHeap* const _heap; - - template - inline void do_oop_work(T* p) { - oop o = _heap->maybe_update_with_forwarded(p); - shenandoah_assert_marked_except(p, o, o == NULL); - } - -public: - ShenandoahWeakUpdateClosure() : _heap(ShenandoahHeap::heap()) {} - - void do_oop(narrowOop* p) { do_oop_work(p); } - void do_oop(oop* p) { do_oop_work(p); } -}; - -class ShenandoahRefProcTaskProxy : public AbstractGangTask { -private: - AbstractRefProcTaskExecutor::ProcessTask& _proc_task; - TaskTerminator* _terminator; - -public: - ShenandoahRefProcTaskProxy(AbstractRefProcTaskExecutor::ProcessTask& proc_task, - TaskTerminator* t) : - AbstractGangTask("Shenandoah Process Weak References"), - _proc_task(proc_task), - _terminator(t) { - } - - void work(uint worker_id) { - Thread* current_thread = Thread::current(); - ResourceMark rm(current_thread); - HandleMark hm(current_thread); - assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); - ShenandoahHeap* heap = ShenandoahHeap::heap(); - ShenandoahParallelWorkerSession worker_session(worker_id); - ShenandoahCMDrainMarkingStackClosure complete_gc(worker_id, _terminator); - if (heap->has_forwarded_objects()) { - ShenandoahForwardedIsAliveClosure is_alive; - ShenandoahCMKeepAliveUpdateClosure keep_alive(heap->concurrent_mark()->get_queue(worker_id)); - _proc_task.work(worker_id, is_alive, keep_alive, complete_gc); - } else { - ShenandoahIsAliveClosure is_alive; - ShenandoahCMKeepAliveClosure keep_alive(heap->concurrent_mark()->get_queue(worker_id)); - _proc_task.work(worker_id, is_alive, keep_alive, complete_gc); - } - } -}; - -class ShenandoahRefProcTaskExecutor : public AbstractRefProcTaskExecutor { -private: - WorkGang* _workers; - -public: - ShenandoahRefProcTaskExecutor(WorkGang* workers) : - _workers(workers) { - } - - // Executes a task using worker threads. - void execute(ProcessTask& task, uint ergo_workers) { - assert(ShenandoahSafepoint::is_at_shenandoah_safepoint(), "Must be at a safepoint"); - - ShenandoahHeap* heap = ShenandoahHeap::heap(); - ShenandoahConcurrentMark* cm = heap->concurrent_mark(); - ShenandoahPushWorkerQueuesScope scope(_workers, cm->task_queues(), - ergo_workers, - /* do_check = */ false); - uint nworkers = _workers->active_workers(); - cm->task_queues()->reserve(nworkers); - TaskTerminator terminator(nworkers, cm->task_queues()); - ShenandoahRefProcTaskProxy proc_task_proxy(task, &terminator); - _workers->run_task(&proc_task_proxy); - } -}; - -void ShenandoahConcurrentMark::weak_refs_work(bool full_gc) { - assert(_heap->process_references(), "sanity"); - - ShenandoahPhaseTimings::Phase phase_root = - full_gc ? - ShenandoahPhaseTimings::full_gc_weakrefs : - ShenandoahPhaseTimings::weakrefs; - - ShenandoahGCPhase phase(phase_root); - - ReferenceProcessor* rp = _heap->ref_processor(); - - // NOTE: We cannot shortcut on has_discovered_references() here, because - // we will miss marking JNI Weak refs then, see implementation in - // ReferenceProcessor::process_discovered_references. - weak_refs_work_doit(full_gc); - - rp->verify_no_references_recorded(); - assert(!rp->discovery_enabled(), "Post condition"); - -} - -void ShenandoahConcurrentMark::weak_refs_work_doit(bool full_gc) { - ReferenceProcessor* rp = _heap->ref_processor(); - - ShenandoahPhaseTimings::Phase phase_process = - full_gc ? - ShenandoahPhaseTimings::full_gc_weakrefs_process : - ShenandoahPhaseTimings::weakrefs_process; - - shenandoah_assert_rp_isalive_not_installed(); - ShenandoahIsAliveSelector is_alive; - ReferenceProcessorIsAliveMutator fix_isalive(rp, is_alive.is_alive_closure()); - - WorkGang* workers = _heap->workers(); - uint nworkers = workers->active_workers(); - - rp->setup_policy(_heap->soft_ref_policy()->should_clear_all_soft_refs()); - rp->set_active_mt_degree(nworkers); - - assert(task_queues()->is_empty(), "Should be empty"); - - // complete_gc and keep_alive closures instantiated here are only needed for - // single-threaded path in RP. They share the queue 0 for tracking work, which - // simplifies implementation. Since RP may decide to call complete_gc several - // times, we need to be able to reuse the terminator. - uint serial_worker_id = 0; - TaskTerminator terminator(1, task_queues()); - ShenandoahCMDrainMarkingStackClosure complete_gc(serial_worker_id, &terminator, /* reset_terminator = */ true); - - ShenandoahRefProcTaskExecutor executor(workers); - - ReferenceProcessorPhaseTimes pt(_heap->gc_timer(), rp->num_queues()); - - { - // Note: Don't emit JFR event for this phase, to avoid overflow nesting phase level. - // Reference Processor emits 2 levels JFR event, that can get us over the JFR - // event nesting level limits, in case of degenerated GC gets upgraded to - // full GC. - ShenandoahTimingsTracker phase_timing(phase_process); - - if (_heap->has_forwarded_objects()) { - ShenandoahCMKeepAliveUpdateClosure keep_alive(get_queue(serial_worker_id)); - const ReferenceProcessorStats& stats = - rp->process_discovered_references(is_alive.is_alive_closure(), &keep_alive, - &complete_gc, &executor, - &pt); - _heap->tracer()->report_gc_reference_stats(stats); - } else { - ShenandoahCMKeepAliveClosure keep_alive(get_queue(serial_worker_id)); - const ReferenceProcessorStats& stats = - rp->process_discovered_references(is_alive.is_alive_closure(), &keep_alive, - &complete_gc, &executor, - &pt); - _heap->tracer()->report_gc_reference_stats(stats); - } - - pt.print_all_references(); - - assert(task_queues()->is_empty(), "Should be empty"); - } -} - -class ShenandoahCancelledGCYieldClosure : public YieldClosure { -private: - ShenandoahHeap* const _heap; -public: - ShenandoahCancelledGCYieldClosure() : _heap(ShenandoahHeap::heap()) {}; - virtual bool should_return() { return _heap->cancelled_gc(); } -}; - -class ShenandoahPrecleanCompleteGCClosure : public VoidClosure { -public: - void do_void() { - ShenandoahHeap* sh = ShenandoahHeap::heap(); - ShenandoahConcurrentMark* scm = sh->concurrent_mark(); - assert(sh->process_references(), "why else would we be here?"); - TaskTerminator terminator(1, scm->task_queues()); - - ReferenceProcessor* rp = sh->ref_processor(); - shenandoah_assert_rp_isalive_installed(); - - scm->mark_loop(0, &terminator, rp, - false, // not cancellable - false); // do not do strdedup - } -}; - -class ShenandoahPrecleanTask : public AbstractGangTask { -private: - ReferenceProcessor* _rp; - -public: - ShenandoahPrecleanTask(ReferenceProcessor* rp) : - AbstractGangTask("Shenandoah Precleaning"), - _rp(rp) {} - - void work(uint worker_id) { - assert(worker_id == 0, "The code below is single-threaded, only one worker is expected"); - ShenandoahParallelWorkerSession worker_session(worker_id); - - ShenandoahHeap* sh = ShenandoahHeap::heap(); - assert(!sh->has_forwarded_objects(), "No forwarded objects expected here"); - - ShenandoahObjToScanQueue* q = sh->concurrent_mark()->get_queue(worker_id); - - ShenandoahCancelledGCYieldClosure yield; - ShenandoahPrecleanCompleteGCClosure complete_gc; - - ShenandoahIsAliveClosure is_alive; - ShenandoahCMKeepAliveClosure keep_alive(q); - ResourceMark rm; - _rp->preclean_discovered_references(&is_alive, &keep_alive, - &complete_gc, &yield, - NULL); - } -}; - -void ShenandoahConcurrentMark::preclean_weak_refs() { - // Pre-cleaning weak references before diving into STW makes sense at the - // end of concurrent mark. This will filter out the references which referents - // are alive. Note that ReferenceProcessor already filters out these on reference - // discovery, and the bulk of work is done here. This phase processes leftovers - // that missed the initial filtering, i.e. when referent was marked alive after - // reference was discovered by RP. - - assert(_heap->process_references(), "sanity"); - - // Shortcut if no references were discovered to avoid winding up threads. - ReferenceProcessor* rp = _heap->ref_processor(); - if (!rp->has_discovered_references()) { - return; - } - - assert(task_queues()->is_empty(), "Should be empty"); - - ReferenceProcessorMTDiscoveryMutator fix_mt_discovery(rp, false); - - shenandoah_assert_rp_isalive_not_installed(); - ShenandoahIsAliveSelector is_alive; - ReferenceProcessorIsAliveMutator fix_isalive(rp, is_alive.is_alive_closure()); - - // Execute precleaning in the worker thread: it will give us GCLABs, String dedup - // queues and other goodies. When upstream ReferenceProcessor starts supporting - // parallel precleans, we can extend this to more threads. - WorkGang* workers = _heap->workers(); - uint nworkers = workers->active_workers(); - assert(nworkers == 1, "This code uses only a single worker"); - task_queues()->reserve(nworkers); - - ShenandoahPrecleanTask task(rp); - workers->run_task(&task); - - assert(task_queues()->is_empty(), "Should be empty"); -} - void ShenandoahConcurrentMark::cancel() { // Clean up marking stacks. ShenandoahObjToScanQueueSet* queues = task_queues(); @@ -876,7 +514,7 @@ ShenandoahObjToScanQueue* ShenandoahConcurrentMark::get_queue(uint worker_id) { } template -void ShenandoahConcurrentMark::mark_loop_prework(uint w, TaskTerminator *t, ReferenceProcessor *rp, +void ShenandoahConcurrentMark::mark_loop_prework(uint w, TaskTerminator *t, ShenandoahReferenceProcessor* rp, bool strdedup) { ShenandoahObjToScanQueue* q = get_queue(w); @@ -934,6 +572,8 @@ void ShenandoahConcurrentMark::mark_loop_work(T* cl, ShenandoahLiveData* live_da ShenandoahObjToScanQueue* q; ShenandoahMarkTask t; + _heap->ref_processor()->set_mark_closure(worker_id, cl); + /* * Process outstanding queues, if any. * diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.hpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.hpp index 554e45c818e5a..2e8538234eea8 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.hpp @@ -32,6 +32,7 @@ #include "gc/shenandoah/shenandoahTaskqueue.hpp" class ShenandoahStrDedupQueue; +class ShenandoahReferenceProcessor; class ShenandoahConcurrentMark: public CHeapObj { private: @@ -49,10 +50,10 @@ class ShenandoahConcurrentMark: public CHeapObj { inline void do_task(ShenandoahObjToScanQueue* q, T* cl, ShenandoahLiveData* live_data, ShenandoahMarkTask* task); template - inline void do_chunked_array_start(ShenandoahObjToScanQueue* q, T* cl, oop array); + inline void do_chunked_array_start(ShenandoahObjToScanQueue* q, T* cl, oop array, bool weak); template - inline void do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop array, int chunk, int pow); + inline void do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop array, int chunk, int pow, bool weak); inline void count_liveness(ShenandoahLiveData* live_data, oop obj); @@ -60,10 +61,10 @@ class ShenandoahConcurrentMark: public CHeapObj { void mark_loop_work(T* cl, ShenandoahLiveData* live_data, uint worker_id, TaskTerminator *t); template - void mark_loop_prework(uint worker_id, TaskTerminator *terminator, ReferenceProcessor *rp, bool strdedup); + void mark_loop_prework(uint worker_id, TaskTerminator *terminator, ShenandoahReferenceProcessor* rp, bool strdedup); public: - void mark_loop(uint worker_id, TaskTerminator* terminator, ReferenceProcessor *rp, + void mark_loop(uint worker_id, TaskTerminator* terminator, ShenandoahReferenceProcessor* rp, bool cancellable, bool strdedup) { if (cancellable) { mark_loop_prework(worker_id, terminator, rp, strdedup); @@ -73,7 +74,7 @@ class ShenandoahConcurrentMark: public CHeapObj { } template - static inline void mark_through_ref(T* p, ShenandoahHeap* heap, ShenandoahObjToScanQueue* q, ShenandoahMarkingContext* const mark_context); + static inline void mark_through_ref(T* p, ShenandoahHeap* heap, ShenandoahObjToScanQueue* q, ShenandoahMarkingContext* const mark_context, bool weak); void mark_from_roots(); void finish_mark_from_roots(bool full_gc); @@ -82,15 +83,6 @@ class ShenandoahConcurrentMark: public CHeapObj { void update_roots(ShenandoahPhaseTimings::Phase root_phase); void update_thread_roots(ShenandoahPhaseTimings::Phase root_phase); -// ---------- Weak references -// -private: - void weak_refs_work(bool full_gc); - void weak_refs_work_doit(bool full_gc); - -public: - void preclean_weak_refs(); - // ---------- Helpers // Used from closures, need to be public // diff --git a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.inline.hpp index fb1e0b0b2fd0c..837c00de2b085 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentMark.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Red Hat, Inc. All rights reserved. + * Copyright (c) 2015, 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 @@ -45,6 +45,10 @@ void ShenandoahConcurrentMark::do_task(ShenandoahObjToScanQueue* q, T* cl, Shena shenandoah_assert_marked(NULL, obj); shenandoah_assert_not_in_cset_except(NULL, obj, _heap->cancelled_gc()); + // Are we in weak subgraph scan? + bool weak = task->is_weak(); + cl->set_weak(weak); + if (task->is_not_chunked()) { if (obj->is_instance()) { // Case 1: Normal oop, process as usual. @@ -52,7 +56,7 @@ void ShenandoahConcurrentMark::do_task(ShenandoahObjToScanQueue* q, T* cl, Shena } else if (obj->is_objArray()) { // Case 2: Object array instance and no chunk is set. Must be the first // time we visit it, start the chunked processing. - do_chunked_array_start(q, cl, obj); + do_chunked_array_start(q, cl, obj, weak); } else { // Case 3: Primitive array. Do nothing, no oops there. We use the same // performance tweak TypeArrayKlass::oop_oop_iterate_impl is using: @@ -61,10 +65,14 @@ void ShenandoahConcurrentMark::do_task(ShenandoahObjToScanQueue* q, T* cl, Shena assert (obj->is_typeArray(), "should be type array"); } // Count liveness the last: push the outstanding work to the queues first - count_liveness(live_data, obj); + // Avoid double-counting objects that are visited twice due to upgrade + // from final- to strong mark. + if (task->count_liveness()) { + count_liveness(live_data, obj); + } } else { // Case 4: Array chunk, has sensible chunk id. Process it. - do_chunked_array(q, cl, obj, task->chunk(), task->pow()); + do_chunked_array(q, cl, obj, task->chunk(), task->pow(), weak); } } @@ -98,7 +106,7 @@ inline void ShenandoahConcurrentMark::count_liveness(ShenandoahLiveData* live_da } template -inline void ShenandoahConcurrentMark::do_chunked_array_start(ShenandoahObjToScanQueue* q, T* cl, oop obj) { +inline void ShenandoahConcurrentMark::do_chunked_array_start(ShenandoahObjToScanQueue* q, T* cl, oop obj, bool weak) { assert(obj->is_objArray(), "expect object array"); objArrayOop array = objArrayOop(obj); int len = array->length(); @@ -129,7 +137,7 @@ inline void ShenandoahConcurrentMark::do_chunked_array_start(ShenandoahObjToScan pow--; chunk = 2; last_idx = (1 << pow); - bool pushed = q->push(ShenandoahMarkTask(array, 1, pow)); + bool pushed = q->push(ShenandoahMarkTask(array, true, weak, 1, pow)); assert(pushed, "overflow queue should always succeed pushing"); } @@ -142,7 +150,7 @@ inline void ShenandoahConcurrentMark::do_chunked_array_start(ShenandoahObjToScan int right_chunk = chunk*2; int left_chunk_end = left_chunk * (1 << pow); if (left_chunk_end < len) { - bool pushed = q->push(ShenandoahMarkTask(array, left_chunk, pow)); + bool pushed = q->push(ShenandoahMarkTask(array, true, weak, left_chunk, pow)); assert(pushed, "overflow queue should always succeed pushing"); chunk = right_chunk; last_idx = left_chunk_end; @@ -160,7 +168,7 @@ inline void ShenandoahConcurrentMark::do_chunked_array_start(ShenandoahObjToScan } template -inline void ShenandoahConcurrentMark::do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop obj, int chunk, int pow) { +inline void ShenandoahConcurrentMark::do_chunked_array(ShenandoahObjToScanQueue* q, T* cl, oop obj, int chunk, int pow, bool weak) { assert(obj->is_objArray(), "expect object array"); objArrayOop array = objArrayOop(obj); @@ -171,7 +179,7 @@ inline void ShenandoahConcurrentMark::do_chunked_array(ShenandoahObjToScanQueue* while ((1 << pow) > (int)ObjArrayMarkingStride && (chunk*2 < ShenandoahMarkTask::chunk_size())) { pow--; chunk *= 2; - bool pushed = q->push(ShenandoahMarkTask(array, chunk - 1, pow)); + bool pushed = q->push(ShenandoahMarkTask(array, true, weak, chunk - 1, pow)); assert(pushed, "overflow queue should always succeed pushing"); } @@ -215,13 +223,13 @@ class ShenandoahSATBBufferClosure : public SATBBufferClosure { void do_buffer_impl(void **buffer, size_t size) { for (size_t i = 0; i < size; ++i) { oop *p = (oop *) &buffer[i]; - ShenandoahConcurrentMark::mark_through_ref(p, _heap, _queue, _mark_context); + ShenandoahConcurrentMark::mark_through_ref(p, _heap, _queue, _mark_context, false); } } }; template -inline void ShenandoahConcurrentMark::mark_through_ref(T *p, ShenandoahHeap* heap, ShenandoahObjToScanQueue* q, ShenandoahMarkingContext* const mark_context) { +inline void ShenandoahConcurrentMark::mark_through_ref(T *p, ShenandoahHeap* heap, ShenandoahObjToScanQueue* q, ShenandoahMarkingContext* const mark_context, bool weak) { T o = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(o)) { oop obj = CompressedOops::decode_not_null(o); @@ -252,8 +260,15 @@ inline void ShenandoahConcurrentMark::mark_through_ref(T *p, ShenandoahHeap* hea shenandoah_assert_not_forwarded(p, obj); shenandoah_assert_not_in_cset_except(p, obj, heap->cancelled_gc()); - if (mark_context->mark(obj)) { - bool pushed = q->push(ShenandoahMarkTask(obj)); + bool skip_live = false; + bool marked; + if (weak) { + marked = mark_context->mark_weak(obj); + } else { + marked = mark_context->mark_strong(obj, /* was_upgraded = */ skip_live); + } + if (marked) { + bool pushed = q->push(ShenandoahMarkTask(obj, skip_live, weak)); assert(pushed, "overflow queue should always succeed pushing"); if ((STRING_DEDUP == ENQUEUE_DEDUP) && ShenandoahStringDedup::is_candidate(obj)) { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp index 5c46deeab42df..b698da1f38b89 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp @@ -141,7 +141,6 @@ void ShenandoahControlThread::run_service() { policy->record_explicit_to_concurrent(); mode = default_mode; // Unload and clean up everything - heap->set_process_references(heuristics->can_process_references()); heap->set_unload_classes(heuristics->can_unload_classes()); } else { policy->record_explicit_to_full(); @@ -158,7 +157,6 @@ void ShenandoahControlThread::run_service() { mode = default_mode; // Unload and clean up everything - heap->set_process_references(heuristics->can_process_references()); heap->set_unload_classes(heuristics->can_unload_classes()); } else { policy->record_implicit_to_full(); @@ -172,7 +170,6 @@ void ShenandoahControlThread::run_service() { } // Ask policy if this cycle wants to process references or unload classes - heap->set_process_references(heuristics->should_process_references()); heap->set_unload_classes(heuristics->should_unload_classes()); } @@ -404,14 +401,12 @@ void ShenandoahControlThread::service_concurrent_normal_cycle(GCCause::Cause cau heap->entry_mark(); if (check_cancellation_or_degen(ShenandoahHeap::_degenerated_mark)) return; - // If not cancelled, can try to concurrently pre-clean - heap->entry_preclean(); - // Complete marking under STW, and start evacuation heap->vmop_entry_final_mark(); // Process weak roots that might still point to regions that would be broken by cleanup if (heap->is_concurrent_weak_root_in_progress()) { + heap->entry_weak_refs(); heap->entry_weak_roots(); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp index 14d67abd5d31e..8bb4bb25df8a4 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp @@ -55,6 +55,7 @@ #include "gc/shenandoah/shenandoahPacer.inline.hpp" #include "gc/shenandoah/shenandoahPadding.hpp" #include "gc/shenandoah/shenandoahParallelCleaning.inline.hpp" +#include "gc/shenandoah/shenandoahReferenceProcessor.hpp" #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp" #include "gc/shenandoah/shenandoahStringDedup.hpp" #include "gc/shenandoah/shenandoahTaskqueue.hpp" @@ -207,10 +208,10 @@ jint ShenandoahHeap::initialize() { // Reserve and commit memory for bitmap(s) // - _bitmap_size = MarkBitMap::compute_size(heap_rs.size()); + _bitmap_size = ShenandoahMarkBitMap::compute_size(heap_rs.size()); _bitmap_size = align_up(_bitmap_size, bitmap_page_size); - size_t bitmap_bytes_per_region = reg_size_bytes / MarkBitMap::heap_map_factor(); + size_t bitmap_bytes_per_region = reg_size_bytes / ShenandoahMarkBitMap::heap_map_factor(); guarantee(bitmap_bytes_per_region != 0, "Bitmap bytes per region should not be zero"); @@ -394,9 +395,6 @@ jint ShenandoahHeap::initialize() { _control_thread = new ShenandoahControlThread(); - _ref_proc_mt_processing = ParallelRefProcEnabled && (ParallelGCThreads > 1); - _ref_proc_mt_discovery = _max_workers > 1; - ShenandoahInitLogger::print(); return JNI_OK; @@ -476,7 +474,7 @@ ShenandoahHeap::ShenandoahHeap(ShenandoahCollectorPolicy* policy) : _gc_timer(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()), _soft_ref_policy(), _log_min_obj_alignment_in_bytes(LogMinObjAlignmentInBytes), - _ref_processor(NULL), + _ref_processor(new ShenandoahReferenceProcessor(MAX2(_max_workers, 1U))), _marking_context(NULL), _bitmap_size(0), _bitmap_regions_per_slice(0), @@ -616,8 +614,6 @@ void ShenandoahHeap::post_initialize() { _scm->initialize(_max_workers); _full_gc->initialize(_gc_timer); - ref_processing_init(); - _heuristics->initialize(); JFR_ONLY(ShenandoahJFRSupport::register_jfr_type_serializers()); @@ -1795,13 +1791,9 @@ void ShenandoahHeap::op_final_mark() { concurrent_mark()->cancel(); set_concurrent_mark_in_progress(false); - if (process_references()) { - // Abandon reference processing right away: pre-cleaning must have failed. - ReferenceProcessor *rp = ref_processor(); - rp->disable_discovery(); - rp->abandon_partial_discovery(); - rp->verify_no_references_recorded(); - } + // Abandon reference processing right away: pre-cleaning must have failed. + ShenandoahReferenceProcessor* rp = ref_processor(); + rp->abandon_partial_discovery(); } } @@ -2008,6 +2000,15 @@ class ShenandoahConcurrentWeakRootsEvacUpdateTask : public AbstractGangTask { } }; +void ShenandoahHeap::op_weak_refs() { + // Concurrent weak refs processing + { + ShenandoahTimingsTracker t(ShenandoahPhaseTimings::conc_weak_refs_work); + ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_weak_refs_work); + ref_processor()->process_references(workers(), true /* concurrent */); + } +} + void ShenandoahHeap::op_weak_roots() { if (is_concurrent_weak_root_in_progress()) { // Concurrent weak root processing @@ -2081,13 +2082,6 @@ void ShenandoahHeap::op_reset() { parallel_heap_region_iterate(&cl); } -void ShenandoahHeap::op_preclean() { - if (ShenandoahPacing) { - pacer()->setup_for_preclean(); - } - concurrent_mark()->preclean_weak_refs(); -} - void ShenandoahHeap::op_full(GCCause::Cause cause) { ShenandoahMetricsSnapshot metrics; metrics.snap_before(); @@ -2129,7 +2123,6 @@ void ShenandoahHeap::op_degenerated(ShenandoahDegenPoint point) { // // Note that we can only do this for "outside-cycle" degens, otherwise we would risk // changing the cycle parameters mid-cycle during concurrent -> degenerated handover. - set_process_references(heuristics()->can_process_references()); set_unload_classes(heuristics()->can_unload_classes()); op_reset(); @@ -2154,6 +2147,12 @@ void ShenandoahHeap::op_degenerated(ShenandoahDegenPoint point) { ShenandoahCodeRoots::disarm_nmethods(); } + { + ShenandoahTimingsTracker t(ShenandoahPhaseTimings::conc_weak_refs_work); + ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_weak_refs_work); + ref_processor()->process_references(workers(), false /* concurrent */); + } + op_cleanup_early(); case _degenerated_evac: @@ -2314,22 +2313,6 @@ void ShenandoahHeap::set_concurrent_weak_root_in_progress(bool in_progress) { } } -void ShenandoahHeap::ref_processing_init() { - assert(_max_workers > 0, "Sanity"); - - _ref_processor = - new ReferenceProcessor(&_subject_to_discovery, // is_subject_to_discovery - _ref_proc_mt_processing, // MT processing - _max_workers, // Degree of MT processing - _ref_proc_mt_discovery, // MT discovery - _max_workers, // Degree of MT discovery - false, // Reference discovery is not atomic - NULL, // No closure, should be installed before use - true); // Scale worker threads - - shenandoah_assert_rp_isalive_not_installed(); -} - GCTracer* ShenandoahHeap::tracer() { return shenandoah_policy()->tracer(); } @@ -2465,18 +2448,10 @@ void ShenandoahHeap::set_has_forwarded_objects(bool cond) { set_gc_state_mask(HAS_FORWARDED, cond); } -void ShenandoahHeap::set_process_references(bool pr) { - _process_references.set_cond(pr); -} - void ShenandoahHeap::set_unload_classes(bool uc) { _unload_classes.set_cond(uc); } -bool ShenandoahHeap::process_references() const { - return _process_references.is_set(); -} - bool ShenandoahHeap::unload_classes() const { return _unload_classes.is_set(); } @@ -3071,6 +3046,19 @@ void ShenandoahHeap::entry_updaterefs() { op_updaterefs(); } +void ShenandoahHeap::entry_weak_refs() { + static const char* msg = "Concurrent weak references"; + ShenandoahConcurrentPhase gc_phase(msg, ShenandoahPhaseTimings::conc_weak_refs); + EventMark em("%s", msg); + + ShenandoahWorkerScope scope(workers(), + ShenandoahWorkerPolicy::calc_workers_for_conc_refs_processing(), + "concurrent weak references"); + + try_inject_alloc_failure(); + op_weak_refs(); +} + void ShenandoahHeap::entry_weak_roots() { static const char* msg = "Concurrent weak roots"; ShenandoahConcurrentPhase gc_phase(msg, ShenandoahPhaseTimings::conc_weak_roots); @@ -3157,22 +3145,6 @@ void ShenandoahHeap::entry_reset() { op_reset(); } -void ShenandoahHeap::entry_preclean() { - if (ShenandoahPreclean && process_references()) { - static const char* msg = "Concurrent precleaning"; - ShenandoahConcurrentPhase gc_phase(msg, ShenandoahPhaseTimings::conc_preclean); - EventMark em("%s", msg); - - ShenandoahWorkerScope scope(workers(), - ShenandoahWorkerPolicy::calc_workers_for_conc_preclean(), - "concurrent preclean", - /* check_workers = */ false); - - try_inject_alloc_failure(); - op_preclean(); - } -} - void ShenandoahHeap::entry_uncommit(double shrink_before, size_t shrink_until) { static const char *msg = "Concurrent uncommit"; ShenandoahConcurrentPhase gc_phase(msg, ShenandoahPhaseTimings::conc_uncommit, true /* log_heap_usage */); @@ -3249,14 +3221,9 @@ void ShenandoahHeap::deduplicate_string(oop str) { const char* ShenandoahHeap::init_mark_event_message() const { assert(!has_forwarded_objects(), "Should not have forwarded objects here"); - bool proc_refs = process_references(); bool unload_cls = unload_classes(); - if (proc_refs && unload_cls) { - return "Pause Init Mark (process weakrefs) (unload classes)"; - } else if (proc_refs) { - return "Pause Init Mark (process weakrefs)"; - } else if (unload_cls) { + if (unload_cls) { return "Pause Init Mark (unload classes)"; } else { return "Pause Init Mark"; @@ -3266,14 +3233,9 @@ const char* ShenandoahHeap::init_mark_event_message() const { const char* ShenandoahHeap::final_mark_event_message() const { assert(!has_forwarded_objects(), "Should not have forwarded objects here"); - bool proc_refs = process_references(); bool unload_cls = unload_classes(); - if (proc_refs && unload_cls) { - return "Pause Final Mark (process weakrefs) (unload classes)"; - } else if (proc_refs) { - return "Pause Final Mark (process weakrefs)"; - } else if (unload_cls) { + if (unload_cls) { return "Pause Final Mark (unload classes)"; } else { return "Pause Final Mark"; @@ -3283,14 +3245,9 @@ const char* ShenandoahHeap::final_mark_event_message() const { const char* ShenandoahHeap::conc_mark_event_message() const { assert(!has_forwarded_objects(), "Should not have forwarded objects here"); - bool proc_refs = process_references(); bool unload_cls = unload_classes(); - if (proc_refs && unload_cls) { - return "Concurrent marking (process weakrefs) (unload classes)"; - } else if (proc_refs) { - return "Concurrent marking (process weakrefs)"; - } else if (unload_cls) { + if (unload_cls) { return "Concurrent marking (unload classes)"; } else { return "Concurrent marking"; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp index 494166a640e5a..3a109a2267324 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp @@ -42,7 +42,6 @@ class ConcurrentGCTimer; class ObjectIterateScanRootClosure; -class ReferenceProcessor; class ShenandoahCollectorPolicy; class ShenandoahControlThread; class ShenandoahGCSession; @@ -60,7 +59,7 @@ class ShenandoahFreeSet; class ShenandoahConcurrentMark; class ShenandoahMarkCompact; class ShenandoahMonitoringSupport; -class ShenandoahObjToScanQueueSet; +class ShenandoahReferenceProcessor; class ShenandoahPacer; class ShenandoahVerifier; class ShenandoahWorkGang; @@ -390,7 +389,7 @@ class ShenandoahHeap : public CollectedHeap { // for concurrent operation. void entry_reset(); void entry_mark(); - void entry_preclean(); + void entry_weak_refs(); void entry_weak_roots(); void entry_class_unloading(); void entry_strong_roots(); @@ -415,7 +414,7 @@ class ShenandoahHeap : public CollectedHeap { void op_reset(); void op_mark(); - void op_preclean(); + void op_weak_refs(); void op_weak_roots(); void op_class_unloading(); void op_strong_roots(); @@ -494,20 +493,10 @@ class ShenandoahHeap : public CollectedHeap { // ---------- Reference processing // private: - AlwaysTrueClosure _subject_to_discovery; - ReferenceProcessor* _ref_processor; - ShenandoahSharedFlag _process_references; - bool _ref_proc_mt_discovery; - bool _ref_proc_mt_processing; - - void ref_processing_init(); + ShenandoahReferenceProcessor* const _ref_processor; public: - ReferenceProcessor* ref_processor() { return _ref_processor; } - bool ref_processor_mt_discovery() { return _ref_proc_mt_discovery; } - bool ref_processor_mt_processing() { return _ref_proc_mt_processing; } - void set_process_references(bool pr); - bool process_references() const; + ShenandoahReferenceProcessor* ref_processor() { return _ref_processor; } // ---------- Class Unloading // diff --git a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp index 3bb97e01f593d..6c49253e2c9fc 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp @@ -401,7 +401,6 @@ inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, ShenandoahMarkingContext* const ctx = complete_marking_context(); assert(ctx->is_complete(), "sanity"); - MarkBitMap* mark_bit_map = ctx->mark_bit_map(); HeapWord* tams = ctx->top_at_mark_start(region); size_t skip_bitmap_delta = 1; @@ -413,7 +412,7 @@ inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, // Try to scan the initial candidate. If the candidate is above the TAMS, it would // fail the subsequent "< limit_bitmap" checks, and fall through to Step 2. - HeapWord* cb = mark_bit_map->get_next_marked_addr(start, end); + HeapWord* cb = ctx->get_next_marked_addr(start, end); intx dist = ShenandoahMarkScanPrefetch; if (dist > 0) { @@ -440,7 +439,7 @@ inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, slots[avail++] = cb; cb += skip_bitmap_delta; if (cb < limit_bitmap) { - cb = mark_bit_map->get_next_marked_addr(cb, limit_bitmap); + cb = ctx->get_next_marked_addr(cb, limit_bitmap); } } @@ -463,7 +462,7 @@ inline void ShenandoahHeap::marked_object_iterate(ShenandoahHeapRegion* region, cl->do_object(obj); cb += skip_bitmap_delta; if (cb < limit_bitmap) { - cb = mark_bit_map->get_next_marked_addr(cb, limit_bitmap); + cb = ctx->get_next_marked_addr(cb, limit_bitmap); } } } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp b/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp index 2c2bc91cfff96..9f0233dd08c14 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp @@ -57,10 +57,6 @@ void ShenandoahInitLogger::print_heap() { log_info(gc, init)("Humongous Object Threshold: " SIZE_FORMAT "%s", byte_size_in_exact_unit(ShenandoahHeapRegion::humongous_threshold_bytes()), exact_unit_for_byte_size(ShenandoahHeapRegion::humongous_threshold_bytes())); - - log_info(gc, init)("Reference Processing: %s discovery, %s processing", - heap->ref_processor_mt_discovery() ? "Parallel" : "Serial", - heap->ref_processor_mt_processing() ? "Parallel" : "Serial"); } void ShenandoahInitLogger::print() { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.cpp new file mode 100644 index 0000000000000..75af01c0cc782 --- /dev/null +++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.cpp @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, Red Hat, Inc. and/or its affiliates. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "gc/shenandoah/shenandoahMarkBitMap.inline.hpp" +#include "gc/shenandoah/shenandoahHeap.inline.hpp" +#include "utilities/globalDefinitions.hpp" + +ShenandoahMarkBitMap::ShenandoahMarkBitMap(MemRegion heap, MemRegion storage) : + _shift(LogMinObjAlignment), + _covered(heap), + _map((BitMap::bm_word_t*) storage.start()), + _size((heap.word_size() * 2) >> _shift) { +} + +size_t ShenandoahMarkBitMap::compute_size(size_t heap_size) { + return ReservedSpace::allocation_align_size_up(heap_size / mark_distance()); +} + +size_t ShenandoahMarkBitMap::mark_distance() { + return MinObjAlignmentInBytes * BitsPerByte / 2; +} + +HeapWord* ShenandoahMarkBitMap::get_next_marked_addr(const HeapWord* addr, + const HeapWord* limit) const { + assert(limit != NULL, "limit must not be NULL"); + // Round addr up to a possible object boundary to be safe. + size_t const addr_offset = address_to_index(align_up(addr, HeapWordSize << LogMinObjAlignment)); + size_t const limit_offset = address_to_index(limit); + size_t const nextOffset = get_next_one_offset(addr_offset, limit_offset); + return index_to_address(nextOffset); +} + +void ShenandoahMarkBitMap::clear_range_within_word(idx_t beg, idx_t end) { + // With a valid range (beg <= end), this test ensures that end != 0, as + // required by inverted_bit_mask_for_range. Also avoids an unnecessary write. + if (beg != end) { + bm_word_t mask = inverted_bit_mask_for_range(beg, end); + *word_addr(beg) &= mask; + } +} + +void ShenandoahMarkBitMap::clear_range(idx_t beg, idx_t end) { + verify_range(beg, end); + + idx_t beg_full_word = to_words_align_up(beg); + idx_t end_full_word = to_words_align_down(end); + + if (beg_full_word < end_full_word) { + // The range includes at least one full word. + clear_range_within_word(beg, bit_index(beg_full_word)); + clear_range_of_words(beg_full_word, end_full_word); + clear_range_within_word(bit_index(end_full_word), end); + } else { + // The range spans at most 2 partial words. + idx_t boundary = MIN2(bit_index(beg_full_word), end); + clear_range_within_word(beg, boundary); + clear_range_within_word(boundary, end); + } +} + +bool ShenandoahMarkBitMap::is_small_range_of_words(idx_t beg_full_word, idx_t end_full_word) { + // There is little point to call large version on small ranges. + // Need to check carefully, keeping potential idx_t over/underflow in mind, + // because beg_full_word > end_full_word can occur when beg and end are in + // the same word. + // The threshold should be at least one word. + STATIC_ASSERT(small_range_words >= 1); + return beg_full_word + small_range_words >= end_full_word; +} + + +void ShenandoahMarkBitMap::clear_large_range(idx_t beg, idx_t end) { + verify_range(beg, end); + + idx_t beg_full_word = to_words_align_up(beg); + idx_t end_full_word = to_words_align_down(end); + + if (is_small_range_of_words(beg_full_word, end_full_word)) { + clear_range(beg, end); + return; + } + + // The range includes at least one full word. + clear_range_within_word(beg, bit_index(beg_full_word)); + clear_large_range_of_words(beg_full_word, end_full_word); + clear_range_within_word(bit_index(end_full_word), end); +} + +void ShenandoahMarkBitMap::clear_range_large(MemRegion mr) { + MemRegion intersection = mr.intersection(_covered); + assert(!intersection.is_empty(), + "Given range from " PTR_FORMAT " to " PTR_FORMAT " is completely outside the heap", + p2i(mr.start()), p2i(mr.end())); + // convert address range into offset range + size_t beg = address_to_index(intersection.start()); + size_t end = address_to_index(intersection.end()); + clear_large_range(beg, end); +} + +#ifdef ASSERT +void ShenandoahMarkBitMap::check_mark(HeapWord* addr) const { + assert(ShenandoahHeap::heap()->is_in(addr), + "Trying to access bitmap " PTR_FORMAT " for address " PTR_FORMAT " not in the heap.", + p2i(this), p2i(addr)); +} + +void ShenandoahMarkBitMap::verify_index(idx_t bit) const { + assert(bit < _size, + "BitMap index out of bounds: " SIZE_FORMAT " >= " SIZE_FORMAT, + bit, _size); +} + +void ShenandoahMarkBitMap::verify_limit(idx_t bit) const { + assert(bit <= _size, + "BitMap limit out of bounds: " SIZE_FORMAT " > " SIZE_FORMAT, + bit, _size); +} + +void ShenandoahMarkBitMap::verify_range(idx_t beg, idx_t end) const { + assert(beg <= end, + "BitMap range error: " SIZE_FORMAT " > " SIZE_FORMAT, beg, end); + verify_limit(end); +} +#endif diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.hpp new file mode 100644 index 0000000000000..a37523f8197f6 --- /dev/null +++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.hpp @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, Red Hat, Inc. and/or its affiliates. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHMARKBITMAP_HPP +#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHMARKBITMAP_HPP + +#include "memory/memRegion.hpp" +#include "runtime/atomic.hpp" +#include "utilities/globalDefinitions.hpp" + +class ShenandoahMarkBitMap { +public: + typedef size_t idx_t; // Type used for bit and word indices. + typedef uintptr_t bm_word_t; // Element type of array that represents the + // bitmap, with BitsPerWord bits per element. + +private: + // Values for get_next_bit_impl flip parameter. + static const bm_word_t find_ones_flip = 0; + static const bm_word_t find_zeros_flip = ~(bm_word_t)0; + + int const _shift; + MemRegion _covered; + + bm_word_t* _map; // First word in bitmap + idx_t _size; // Size of bitmap (in bits) + + // Threshold for performing small range operation, even when large range + // operation was requested. Measured in words. + static const size_t small_range_words = 32; + + static bool is_small_range_of_words(idx_t beg_full_word, idx_t end_full_word); + + inline size_t address_to_index(const HeapWord* addr) const; + inline HeapWord* index_to_address(size_t offset) const; + + void check_mark(HeapWord* addr) const NOT_DEBUG_RETURN; + + // Return a mask that will select the specified bit, when applied to the word + // containing the bit. + static bm_word_t bit_mask(idx_t bit) { return (bm_word_t)1 << bit_in_word(bit); } + + // Return the bit number of the first bit in the specified word. + static idx_t bit_index(idx_t word) { return word << LogBitsPerWord; } + + // Return the position of bit within the word that contains it (e.g., if + // bitmap words are 32 bits, return a number 0 <= n <= 31). + static idx_t bit_in_word(idx_t bit) { return bit & (BitsPerWord - 1); } + + bm_word_t* map() { return _map; } + const bm_word_t* map() const { return _map; } + bm_word_t map(idx_t word) const { return _map[word]; } + + // Return a pointer to the word containing the specified bit. + bm_word_t* word_addr(idx_t bit) { + return map() + to_words_align_down(bit); + } + + const bm_word_t* word_addr(idx_t bit) const { + return map() + to_words_align_down(bit); + } + + static inline const bm_word_t load_word_ordered(const volatile bm_word_t* const addr, atomic_memory_order memory_order); + + bool at(idx_t index) const { + verify_index(index); + return (*word_addr(index) & bit_mask(index)) != 0; + } + + // Assumes relevant validity checking for bit has already been done. + static idx_t raw_to_words_align_up(idx_t bit) { + return raw_to_words_align_down(bit + (BitsPerWord - 1)); + } + + // Assumes relevant validity checking for bit has already been done. + static idx_t raw_to_words_align_down(idx_t bit) { + return bit >> LogBitsPerWord; + } + + // Word-aligns bit and converts it to a word offset. + // precondition: bit <= size() + idx_t to_words_align_up(idx_t bit) const { + verify_limit(bit); + return raw_to_words_align_up(bit); + } + + // Word-aligns bit and converts it to a word offset. + // precondition: bit <= size() + inline idx_t to_words_align_down(idx_t bit) const { + verify_limit(bit); + return raw_to_words_align_down(bit); + } + + // Helper for get_next_{zero,one}_bit variants. + // - flip designates whether searching for 1s or 0s. Must be one of + // find_{zeros,ones}_flip. + // - aligned_right is true if r_index is a priori on a bm_word_t boundary. + template + inline idx_t get_next_bit_impl(idx_t l_index, idx_t r_index) const; + + inline idx_t get_next_one_offset (idx_t l_index, idx_t r_index) const; + + void clear_large_range (idx_t beg, idx_t end); + + // Verify bit is less than size(). + void verify_index(idx_t bit) const NOT_DEBUG_RETURN; + // Verify bit is not greater than size(). + void verify_limit(idx_t bit) const NOT_DEBUG_RETURN; + // Verify [beg,end) is a valid range, e.g. beg <= end <= size(). + void verify_range(idx_t beg, idx_t end) const NOT_DEBUG_RETURN; + +public: + static size_t compute_size(size_t heap_size); + // Returns the amount of bytes on the heap between two marks in the bitmap. + static size_t mark_distance(); + // Returns how many bytes (or bits) of the heap a single byte (or bit) of the + // mark bitmap corresponds to. This is the same as the mark distance above. + static size_t heap_map_factor() { + return mark_distance(); + } + + ShenandoahMarkBitMap(MemRegion heap, MemRegion storage); + + // Mark word as 'strong' if it hasn't been marked strong yet. + // Return true if the word has been marked strong, false if it has already been + // marked strong or if another thread has beat us by marking it + // strong. + // Words that have been marked final before or by a concurrent thread will be + // upgraded to strong. In this case, this method also returns true. + inline bool mark_strong(HeapWord* w, bool& was_upgraded); + + // Mark word as 'weak' if it hasn't been marked weak or strong yet. + // Return true if the word has been marked weak, false if it has already been + // marked strong or weak or if another thread has beat us by marking it + // strong or weak. + inline bool mark_weak(HeapWord* heap_addr); + + inline bool is_marked(HeapWord* addr) const; + inline bool is_marked_strong(HeapWord* w) const; + inline bool is_marked_weak(HeapWord* addr) const; + + // Return the address corresponding to the next marked bit at or after + // "addr", and before "limit", if "limit" is non-NULL. If there is no + // such bit, returns "limit" if that is non-NULL, or else "endWord()". + HeapWord* get_next_marked_addr(const HeapWord* addr, + const HeapWord* limit) const; + + bm_word_t inverted_bit_mask_for_range(idx_t beg, idx_t end) const; + void clear_range_within_word (idx_t beg, idx_t end); + void clear_range (idx_t beg, idx_t end); + void clear_range_large(MemRegion mr); + + void clear_range_of_words(idx_t beg, idx_t end); + void clear_large_range_of_words(idx_t beg, idx_t end); + static void clear_range_of_words(bm_word_t* map, idx_t beg, idx_t end); + +}; + +#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHMARKBITMAP_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.inline.hpp new file mode 100644 index 0000000000000..b9e0bb61f54c5 --- /dev/null +++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkBitMap.inline.hpp @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, Red Hat, Inc. and/or its affiliates. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHMARKBITMAP_INLINE_HPP +#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHMARKBITMAP_INLINE_HPP + +#include "gc/shenandoah/shenandoahMarkBitMap.hpp" +#include "runtime/atomic.hpp" +#include "utilities/count_trailing_zeros.hpp" + +inline size_t ShenandoahMarkBitMap::address_to_index(const HeapWord* addr) const { + return (pointer_delta(addr, _covered.start()) << 1) >> _shift; +} + +inline HeapWord* ShenandoahMarkBitMap::index_to_address(size_t offset) const { + return _covered.start() + ((offset >> 1) << _shift); +} + +inline bool ShenandoahMarkBitMap::mark_strong(HeapWord* heap_addr, bool& was_upgraded) { + check_mark(heap_addr); + + idx_t bit = address_to_index(heap_addr); + verify_index(bit); + volatile bm_word_t* const addr = word_addr(bit); + const bm_word_t mask = bit_mask(bit); + const bm_word_t mask_weak = (bm_word_t)1 << (bit_in_word(bit) + 1); + bm_word_t old_val = load_word_ordered(addr, memory_order_conservative); + + do { + const bm_word_t new_val = old_val | mask; + if (new_val == old_val) { + assert(!was_upgraded, "Should be false already"); + return false; // Someone else beat us to it. + } + const bm_word_t cur_val = Atomic::cmpxchg(addr, old_val, new_val, memory_order_conservative); + if (cur_val == old_val) { + was_upgraded = (cur_val & mask_weak) != 0; + return true; // Success. + } + old_val = cur_val; // The value changed, try again. + } while (true); +} + +inline bool ShenandoahMarkBitMap::mark_weak(HeapWord* heap_addr) { + check_mark(heap_addr); + + idx_t bit = address_to_index(heap_addr); + verify_index(bit); + volatile bm_word_t* const addr = word_addr(bit); + const bm_word_t mask_weak = (bm_word_t)1 << (bit_in_word(bit) + 1); + const bm_word_t mask_strong = (bm_word_t)1 << bit_in_word(bit); + bm_word_t old_val = load_word_ordered(addr, memory_order_conservative); + + do { + if ((old_val & mask_strong) != 0) { + return false; // Already marked strong + } + const bm_word_t new_val = old_val | mask_weak; + if (new_val == old_val) { + return false; // Someone else beat us to it. + } + const bm_word_t cur_val = Atomic::cmpxchg(addr, old_val, new_val, memory_order_conservative); + if (cur_val == old_val) { + return true; // Success. + } + old_val = cur_val; // The value changed, try again. + } while (true); +} + +inline bool ShenandoahMarkBitMap::is_marked_strong(HeapWord* addr) const { + check_mark(addr); + return at(address_to_index(addr)); +} + +inline bool ShenandoahMarkBitMap::is_marked_weak(HeapWord* addr) const { + check_mark(addr); + return at(address_to_index(addr) + 1); +} + +inline bool ShenandoahMarkBitMap::is_marked(HeapWord* addr) const { + check_mark(addr); + idx_t index = address_to_index(addr); + verify_index(index); + bm_word_t mask = (bm_word_t)3 << bit_in_word(index); + return (*word_addr(index) & mask) != 0; +} + +inline const ShenandoahMarkBitMap::bm_word_t ShenandoahMarkBitMap::load_word_ordered(const volatile bm_word_t* const addr, atomic_memory_order memory_order) { + if (memory_order == memory_order_relaxed || memory_order == memory_order_release) { + return Atomic::load(addr); + } else { + assert(memory_order == memory_order_acq_rel || + memory_order == memory_order_acquire || + memory_order == memory_order_conservative, + "unexpected memory ordering"); + return Atomic::load_acquire(addr); + } +} + +template +inline ShenandoahMarkBitMap::idx_t ShenandoahMarkBitMap::get_next_bit_impl(idx_t l_index, idx_t r_index) const { + STATIC_ASSERT(flip == find_ones_flip || flip == find_zeros_flip); + verify_range(l_index, r_index); + assert(!aligned_right || is_aligned(r_index, BitsPerWord), "r_index not aligned"); + + // The first word often contains an interesting bit, either due to + // density or because of features of the calling algorithm. So it's + // important to examine that first word with a minimum of fuss, + // minimizing setup time for later words that will be wasted if the + // first word is indeed interesting. + + // The benefit from aligned_right being true is relatively small. + // It saves an operation in the setup for the word search loop. + // It also eliminates the range check on the final result. + // However, callers often have a comparison with r_index, and + // inlining often allows the two comparisons to be combined; it is + // important when !aligned_right that return paths either return + // r_index or a value dominated by a comparison with r_index. + // aligned_right is still helpful when the caller doesn't have a + // range check because features of the calling algorithm guarantee + // an interesting bit will be present. + + if (l_index < r_index) { + // Get the word containing l_index, and shift out low bits. + idx_t index = to_words_align_down(l_index); + bm_word_t cword = (map(index) ^ flip) >> bit_in_word(l_index); + if ((cword & 1) != 0) { + // The first bit is similarly often interesting. When it matters + // (density or features of the calling algorithm make it likely + // the first bit is set), going straight to the next clause compares + // poorly with doing this check first; count_trailing_zeros can be + // relatively expensive, plus there is the additional range check. + // But when the first bit isn't set, the cost of having tested for + // it is relatively small compared to the rest of the search. + return l_index; + } else if (cword != 0) { + // Flipped and shifted first word is non-zero. + idx_t result = l_index + count_trailing_zeros(cword); + if (aligned_right || (result < r_index)) return result; + // Result is beyond range bound; return r_index. + } else { + // Flipped and shifted first word is zero. Word search through + // aligned up r_index for a non-zero flipped word. + idx_t limit = aligned_right + ? to_words_align_down(r_index) // Miniscule savings when aligned. + : to_words_align_up(r_index); + while (++index < limit) { + cword = map(index) ^ flip; + if (cword != 0) { + idx_t result = bit_index(index) + count_trailing_zeros(cword); + if (aligned_right || (result < r_index)) return result; + // Result is beyond range bound; return r_index. + assert((index + 1) == limit, "invariant"); + break; + } + } + // No bits in range; return r_index. + } + } + return r_index; +} + +inline ShenandoahMarkBitMap::idx_t ShenandoahMarkBitMap::get_next_one_offset(idx_t l_offset, idx_t r_offset) const { + return get_next_bit_impl(l_offset, r_offset); +} + +// Returns a bit mask for a range of bits [beg, end) within a single word. Each +// bit in the mask is 0 if the bit is in the range, 1 if not in the range. The +// returned mask can be used directly to clear the range, or inverted to set the +// range. Note: end must not be 0. +inline ShenandoahMarkBitMap::bm_word_t +ShenandoahMarkBitMap::inverted_bit_mask_for_range(idx_t beg, idx_t end) const { + assert(end != 0, "does not work when end == 0"); + assert(beg == end || to_words_align_down(beg) == to_words_align_down(end - 1), + "must be a single-word range"); + bm_word_t mask = bit_mask(beg) - 1; // low (right) bits + if (bit_in_word(end) != 0) { + mask |= ~(bit_mask(end) - 1); // high (left) bits + } + return mask; +} + +inline void ShenandoahMarkBitMap::clear_range_of_words(bm_word_t* map, idx_t beg, idx_t end) { + for (idx_t i = beg; i < end; ++i) map[i] = 0; +} + +inline void ShenandoahMarkBitMap::clear_large_range_of_words(idx_t beg, idx_t end) { + assert(beg <= end, "underflow"); + memset(_map + beg, 0, (end - beg) * sizeof(bm_word_t)); +} + +inline void ShenandoahMarkBitMap::clear_range_of_words(idx_t beg, idx_t end) { + clear_range_of_words(_map, beg, end); +} + + +#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHMARKBITMAP_INLINE_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp index 9993a9c612b86..846b42c73ad2b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkCompact.cpp @@ -38,6 +38,7 @@ #include "gc/shenandoah/shenandoahHeap.inline.hpp" #include "gc/shenandoah/shenandoahHeapRegion.inline.hpp" #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp" +#include "gc/shenandoah/shenandoahReferenceProcessor.hpp" #include "gc/shenandoah/shenandoahRootProcessor.inline.hpp" #include "gc/shenandoah/shenandoahTaskqueue.inline.hpp" #include "gc/shenandoah/shenandoahUtils.hpp" @@ -129,10 +130,8 @@ void ShenandoahMarkCompact::do_it(GCCause::Cause gc_cause) { assert(!heap->marking_context()->is_complete(), "sanity"); // e. Abandon reference discovery and clear all discovered references. - ReferenceProcessor* rp = heap->ref_processor(); - rp->disable_discovery(); + ShenandoahReferenceProcessor* rp = heap->ref_processor(); rp->abandon_partial_discovery(); - rp->verify_no_references_recorded(); // f. Set back forwarded objects bit back, in case some steps above dropped it. heap->set_has_forwarded_objects(has_forwarded_objects); @@ -241,18 +240,16 @@ void ShenandoahMarkCompact::phase1_mark_heap() { ShenandoahConcurrentMark* cm = heap->concurrent_mark(); - heap->set_process_references(heap->heuristics()->can_process_references()); heap->set_unload_classes(heap->heuristics()->can_unload_classes()); - ReferenceProcessor* rp = heap->ref_processor(); + ShenandoahReferenceProcessor* rp = heap->ref_processor(); // enable ("weak") refs discovery - rp->enable_discovery(true /*verify_no_refs*/); - rp->setup_policy(true); // forcefully purge all soft references - rp->set_active_mt_degree(heap->workers()->active_workers()); + rp->set_soft_reference_policy(true); // forcefully purge all soft references cm->mark_roots(ShenandoahPhaseTimings::full_gc_scan_roots); cm->finish_mark_from_roots(/* full_gc = */ true); heap->mark_complete_marking_context(); + rp->process_references(heap->workers(), false /* concurrent */); heap->parallel_cleaning(true /* full_gc */); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp index eea57c3dd5d04..df5c2f114db19 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.cpp @@ -29,11 +29,11 @@ #include "gc/shenandoah/shenandoahMarkingContext.hpp" ShenandoahMarkingContext::ShenandoahMarkingContext(MemRegion heap_region, MemRegion bitmap_region, size_t num_regions) : + _mark_bit_map(heap_region, bitmap_region), _top_bitmaps(NEW_C_HEAP_ARRAY(HeapWord*, num_regions, mtGC)), _top_at_mark_starts_base(NEW_C_HEAP_ARRAY(HeapWord*, num_regions, mtGC)), _top_at_mark_starts(_top_at_mark_starts_base - ((uintx) heap_region.start() >> ShenandoahHeapRegion::region_size_bytes_shift())) { - _mark_bit_map.initialize(heap_region, bitmap_region); } bool ShenandoahMarkingContext::is_bitmap_clear() const { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp index 8274afa2c192b..a17f968003203 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp @@ -25,7 +25,8 @@ #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_HPP #define SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_HPP -#include "gc/shared/markBitMap.hpp" +#include "gc/shenandoah/shenandoahMarkBitMap.hpp" +#include "gc/shenandoah/shenandoahSharedVariables.hpp" #include "memory/allocation.hpp" #include "memory/memRegion.hpp" #include "oops/oopsHierarchy.hpp" @@ -35,7 +36,7 @@ */ class ShenandoahMarkingContext : public CHeapObj { private: - MarkBitMap _mark_bit_map; + ShenandoahMarkBitMap _mark_bit_map; HeapWord** const _top_bitmaps; HeapWord** const _top_at_mark_starts_base; @@ -51,15 +52,19 @@ class ShenandoahMarkingContext : public CHeapObj { * been marked by this thread. Returns false if the object has already been marked, * or if a competing thread succeeded in marking this object. */ - inline bool mark(oop obj); + inline bool mark_strong(oop obj, bool& was_upgraded); + inline bool mark_weak(oop obj); - inline bool is_marked(oop obj) const; + // Simple versions of marking accessors, to be used outside of marking (e.g. no possible concurrent updates) + inline bool is_marked(oop) const; + inline bool is_marked_strong(oop obj) const; + inline bool is_marked_weak(oop obj) const; + + inline HeapWord* get_next_marked_addr(HeapWord* addr, HeapWord* limit) const; inline bool allocated_after_mark_start(oop obj) const; inline bool allocated_after_mark_start(HeapWord* addr) const; - inline MarkBitMap* mark_bit_map(); - inline HeapWord* top_at_mark_start(ShenandoahHeapRegion* r) const; inline void capture_top_at_mark_start(ShenandoahHeapRegion* r); inline void reset_top_at_mark_start(ShenandoahHeapRegion* r); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp index 338f30f86b18f..5cb3bd5c35315 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp @@ -25,19 +25,33 @@ #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_INLINE_HPP #define SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_INLINE_HPP +#include "gc/shenandoah/shenandoahMarkBitMap.inline.hpp" #include "gc/shenandoah/shenandoahMarkingContext.hpp" -inline MarkBitMap* ShenandoahMarkingContext::mark_bit_map() { - return &_mark_bit_map; +inline bool ShenandoahMarkingContext::mark_strong(oop obj, bool& was_upgraded) { + shenandoah_assert_not_forwarded(NULL, obj); + return (! allocated_after_mark_start(obj)) && _mark_bit_map.mark_strong(cast_from_oop(obj), was_upgraded); } -inline bool ShenandoahMarkingContext::mark(oop obj) { +inline bool ShenandoahMarkingContext::mark_weak(oop obj) { shenandoah_assert_not_forwarded(NULL, obj); - return (! allocated_after_mark_start(obj)) && _mark_bit_map.par_mark(obj); + return (! allocated_after_mark_start(obj)) && _mark_bit_map.mark_weak(cast_from_oop(obj)); } inline bool ShenandoahMarkingContext::is_marked(oop obj) const { - return allocated_after_mark_start(obj) || _mark_bit_map.is_marked(obj); + return allocated_after_mark_start(obj) || _mark_bit_map.is_marked(cast_from_oop(obj)); +} + +inline bool ShenandoahMarkingContext::is_marked_strong(oop obj) const { + return allocated_after_mark_start(obj) || _mark_bit_map.is_marked_strong(cast_from_oop(obj)); +} + +inline bool ShenandoahMarkingContext::is_marked_weak(oop obj) const { + return allocated_after_mark_start(obj) || _mark_bit_map.is_marked_weak(cast_from_oop(obj)); +} + +inline HeapWord* ShenandoahMarkingContext::get_next_marked_addr(HeapWord* start, HeapWord* limit) const { + return _mark_bit_map.get_next_marked_addr(start, limit); } inline bool ShenandoahMarkingContext::allocated_after_mark_start(oop obj) const { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp index a175fc1743fd6..e9dceaad0717d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.hpp @@ -49,13 +49,22 @@ class ShenandoahMarkRefsSuperClosure : public MetadataVisitingOopIterateClosure ShenandoahObjToScanQueue* _queue; ShenandoahHeap* _heap; ShenandoahMarkingContext* const _mark_context; + bool _weak; protected: template void work(T *p); public: - ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp); + ShenandoahMarkRefsSuperClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp); + + bool is_weak() const { + return _weak; + } + + void set_weak(bool weak) { + _weak = weak; + } }; class ShenandoahMarkUpdateRefsClosure : public ShenandoahMarkRefsSuperClosure { @@ -64,7 +73,7 @@ class ShenandoahMarkUpdateRefsClosure : public ShenandoahMarkRefsSuperClosure { inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkUpdateRefsClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkUpdateRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } @@ -78,7 +87,7 @@ class ShenandoahMarkUpdateRefsDedupClosure : public ShenandoahMarkRefsSuperClosu inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkUpdateRefsDedupClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkUpdateRefsDedupClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } @@ -92,7 +101,7 @@ class ShenandoahMarkUpdateRefsMetadataClosure : public ShenandoahMarkRefsSuperCl inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkUpdateRefsMetadataClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkUpdateRefsMetadataClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } @@ -106,7 +115,7 @@ class ShenandoahMarkUpdateRefsMetadataDedupClosure : public ShenandoahMarkRefsSu inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkUpdateRefsMetadataDedupClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkUpdateRefsMetadataDedupClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } @@ -120,7 +129,7 @@ class ShenandoahMarkRefsClosure : public ShenandoahMarkRefsSuperClosure { inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkRefsClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } @@ -134,7 +143,7 @@ class ShenandoahMarkRefsDedupClosure : public ShenandoahMarkRefsSuperClosure { inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkRefsDedupClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkRefsDedupClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } @@ -148,7 +157,7 @@ class ShenandoahMarkResolveRefsClosure : public ShenandoahMarkRefsSuperClosure { inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkResolveRefsClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkResolveRefsClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } @@ -162,7 +171,7 @@ class ShenandoahMarkRefsMetadataClosure : public ShenandoahMarkRefsSuperClosure inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkRefsMetadataClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkRefsMetadataClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } @@ -176,7 +185,7 @@ class ShenandoahMarkRefsMetadataDedupClosure : public ShenandoahMarkRefsSuperClo inline void do_oop_work(T* p) { work(p); } public: - ShenandoahMarkRefsMetadataDedupClosure(ShenandoahObjToScanQueue* q, ReferenceProcessor* rp) : + ShenandoahMarkRefsMetadataDedupClosure(ShenandoahObjToScanQueue* q, ShenandoahReferenceProcessor* rp) : ShenandoahMarkRefsSuperClosure(q, rp) {}; virtual void do_oop(narrowOop* p) { do_oop_work(p); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp index 1adebeaac0e53..3476f65a7fe1e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahOopClosures.inline.hpp @@ -30,7 +30,7 @@ template inline void ShenandoahMarkRefsSuperClosure::work(T *p) { - ShenandoahConcurrentMark::mark_through_ref(p, _heap, _queue, _mark_context); + ShenandoahConcurrentMark::mark_through_ref(p, _heap, _queue, _mark_context, _weak); } template diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp index 30c875551f831..d8866ebd6ddc9 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp @@ -153,16 +153,6 @@ void ShenandoahPacer::setup_for_idle() { * the allocators unnecessarily, allow them to run unimpeded. */ -void ShenandoahPacer::setup_for_preclean() { - assert(ShenandoahPacing, "Only be here when pacing is enabled"); - - size_t initial = _heap->max_capacity(); - restart_with(initial, 1.0); - - log_info(gc, ergo)("Pacer for Precleaning. Non-Taxable: " SIZE_FORMAT "%s", - byte_size_in_proper_unit(initial), proper_unit_for_byte_size(initial)); -} - void ShenandoahPacer::setup_for_reset() { assert(ShenandoahPacing, "Only be here when pacing is enabled"); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp index d177581ac78a2..6b2dd53ff760e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPacer.hpp @@ -79,7 +79,6 @@ class ShenandoahPacer : public CHeapObj { void setup_for_updaterefs(); void setup_for_reset(); - void setup_for_preclean(); inline void report_mark(size_t words); inline void report_evac(size_t words); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp index 797fcb8478925..b65746c3791a1 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp @@ -113,6 +113,7 @@ bool ShenandoahPhaseTimings::is_worker_phase(Phase phase) { case heap_iteration_roots: case conc_mark_roots: case conc_weak_roots_work: + case conc_weak_refs_work: case conc_strong_roots: return true; default: diff --git a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp index cd9e2f642815d..200429898d7bd 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.hpp @@ -59,8 +59,6 @@ class outputStream; f(conc_mark_roots, " Roots ") \ SHENANDOAH_PAR_PHASE_DO(conc_mark_roots, " CM: ", f) \ \ - f(conc_preclean, "Concurrent Precleaning") \ - \ f(final_mark_gross, "Pause Final Mark (G)") \ f(final_mark, "Pause Final Mark (N)") \ f(update_roots, " Update Roots") \ @@ -81,6 +79,9 @@ class outputStream; f(init_evac, " Initial Evacuation") \ SHENANDOAH_PAR_PHASE_DO(evac_, " E: ", f) \ \ + f(conc_weak_refs, "Concurrent Weak References") \ + f(conc_weak_refs_work, " Process") \ + SHENANDOAH_PAR_PHASE_DO(conc_weak_refs_work_, " CWRF: ", f) \ f(conc_weak_roots, "Concurrent Weak Roots") \ f(conc_weak_roots_work, " Roots") \ SHENANDOAH_PAR_PHASE_DO(conc_weak_roots_work_, " CWR: ", f) \ diff --git a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp new file mode 100644 index 0000000000000..9cdfa5d6e6560 --- /dev/null +++ b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp @@ -0,0 +1,593 @@ +/* + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, Red Hat, Inc. and/or its affiliates. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "gc/shenandoah/shenandoahOopClosures.hpp" +#include "gc/shenandoah/shenandoahReferenceProcessor.hpp" +#include "gc/shenandoah/shenandoahThreadLocalData.hpp" +#include "gc/shenandoah/shenandoahUtils.hpp" +#include "runtime/atomic.hpp" +#include "logging/log.hpp" + +static ReferenceType reference_type(oop reference) { + return InstanceKlass::cast(reference->klass())->reference_type(); +} + +static const char* reference_type_name(ReferenceType type) { + switch (type) { + case REF_SOFT: + return "Soft"; + + case REF_WEAK: + return "Weak"; + + case REF_FINAL: + return "Final"; + + case REF_PHANTOM: + return "Phantom"; + + default: + ShouldNotReachHere(); + return NULL; + } +} + +template +static void set_oop_field(T* field, oop value); + +template <> +void set_oop_field(oop* field, oop value) { + *field = value; +} + +template <> +void set_oop_field(narrowOop* field, oop value) { + *field = CompressedOops::encode(value); +} + +static oop lrb(oop obj) { + if (obj != NULL && ShenandoahHeap::heap()->marking_context()->is_marked(obj)) { + return ShenandoahBarrierSet::barrier_set()->load_reference_barrier(obj); + } else { + return obj; + } +} + +template +static volatile T* reference_referent_addr(oop reference) { + return (volatile T*)java_lang_ref_Reference::referent_addr_raw(reference); +} + +template +static oop reference_referent(oop reference) { + T heap_oop = Atomic::load(reference_referent_addr(reference)); + return CompressedOops::decode(heap_oop); +} + +static void reference_set_referent(oop reference, oop referent) { + java_lang_ref_Reference::set_referent_raw(reference, referent); +} + +template +static T* reference_discovered_addr(oop reference) { + return reinterpret_cast(java_lang_ref_Reference::discovered_addr_raw(reference)); +} + +template +static oop reference_discovered(oop reference) { + T heap_oop = *reference_discovered_addr(reference); + return lrb(CompressedOops::decode(heap_oop)); +} + +template +static void reference_set_discovered(oop reference, oop discovered); + +template <> +void reference_set_discovered(oop reference, oop discovered) { + *reference_discovered_addr(reference) = discovered; +} + +template <> +void reference_set_discovered(oop reference, oop discovered) { + *reference_discovered_addr(reference) = CompressedOops::encode(discovered); +} + +template +static bool reference_cas_discovered(oop reference, oop discovered); + +template<> +bool reference_cas_discovered(oop reference, oop discovered) { + volatile narrowOop* addr = reinterpret_cast(java_lang_ref_Reference::discovered_addr_raw(reference)); + narrowOop compare = CompressedOops::encode(NULL); + narrowOop exchange = CompressedOops::encode(discovered); + return Atomic::cmpxchg(addr, compare, exchange) == compare; +} + +template<> +bool reference_cas_discovered(oop reference, oop discovered) { + volatile oop* addr = reinterpret_cast(java_lang_ref_Reference::discovered_addr_raw(reference)); + return Atomic::cmpxchg(addr, oop(NULL), discovered) == NULL; +} + +template +static T* reference_next_addr(oop reference) { + return reinterpret_cast(java_lang_ref_Reference::next_addr_raw(reference)); +} + +template +static oop reference_next(oop reference) { + T heap_oop = RawAccess<>::oop_load(reference_next_addr(reference)); + return lrb(CompressedOops::decode(heap_oop)); +} + +static void reference_set_next(oop reference, oop next) { + java_lang_ref_Reference::set_next_raw(reference, next); +} + +static void soft_reference_update_clock() { + const jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; + java_lang_ref_SoftReference::set_clock(now); +} + +ShenandoahRefProcThreadLocal::ShenandoahRefProcThreadLocal() : + _discovered_list(NULL), + _encountered_count(), + _discovered_count(), + _enqueued_count() { +} + +void ShenandoahRefProcThreadLocal::reset() { + _discovered_list = NULL; + _mark_closure = NULL; + for (uint i = 0; i < reference_type_count; i++) { + _encountered_count[i] = 0; + _discovered_count[i] = 0; + _enqueued_count[i] = 0; + } +} + +template +T* ShenandoahRefProcThreadLocal::discovered_list_addr() { + return reinterpret_cast(&_discovered_list); +} + +template <> +oop ShenandoahRefProcThreadLocal::discovered_list_head() const { + return *reinterpret_cast(&_discovered_list); +} + +template <> +oop ShenandoahRefProcThreadLocal::discovered_list_head() const { + return CompressedOops::decode(*reinterpret_cast(&_discovered_list)); +} + +template <> +void ShenandoahRefProcThreadLocal::set_discovered_list_head(oop head) { + *discovered_list_addr() = CompressedOops::encode(head); +} + +template <> +void ShenandoahRefProcThreadLocal::set_discovered_list_head(oop head) { + *discovered_list_addr() = head; +} + +ShenandoahReferenceProcessor::ShenandoahReferenceProcessor(uint max_workers) : + _soft_reference_policy(NULL), + _ref_proc_thread_locals(NEW_C_HEAP_ARRAY(ShenandoahRefProcThreadLocal, max_workers, mtGC)), + _pending_list(NULL), + _pending_list_tail(&_pending_list), + _iterate_discovered_list_id(0U) { + for (size_t i = 0; i < max_workers; i++) { + _ref_proc_thread_locals[i].reset(); + } +} + +void ShenandoahReferenceProcessor::reset_thread_locals() { + uint max_workers = ShenandoahHeap::heap()->max_workers(); + for (uint i = 0; i < max_workers; i++) { + _ref_proc_thread_locals[i].reset(); + } +} + +void ShenandoahReferenceProcessor::set_mark_closure(uint worker_id, ShenandoahMarkRefsSuperClosure* mark_closure) { + _ref_proc_thread_locals[worker_id].set_mark_closure(mark_closure); +} + +void ShenandoahReferenceProcessor::set_soft_reference_policy(bool clear) { + static AlwaysClearPolicy always_clear_policy; + static LRUMaxHeapPolicy lru_max_heap_policy; + + if (clear) { + log_info(gc, ref)("Clearing All SoftReferences"); + _soft_reference_policy = &always_clear_policy; + } else { + _soft_reference_policy = &lru_max_heap_policy; + } + + _soft_reference_policy->setup(); +} + +template +bool ShenandoahReferenceProcessor::is_inactive(oop reference, oop referent, ReferenceType type) const { + if (type == REF_FINAL) { + // A FinalReference is inactive if its next field is non-null. An application can't + // call enqueue() or clear() on a FinalReference. + return reference_next(reference) != NULL; + } else { + // A non-FinalReference is inactive if the referent is null. The referent can only + // be null if the application called Reference.enqueue() or Reference.clear(). + return referent == NULL; + } +} + +bool ShenandoahReferenceProcessor::is_strongly_live(oop referent) const { + return ShenandoahHeap::heap()->marking_context()->is_marked_strong(referent); +} + +bool ShenandoahReferenceProcessor::is_softly_live(oop reference, ReferenceType type) const { + if (type != REF_SOFT) { + // Not a SoftReference + return false; + } + + // Ask SoftReference policy + const jlong clock = java_lang_ref_SoftReference::clock(); + assert(clock != 0, "Clock not initialized"); + assert(_soft_reference_policy != NULL, "Policy not initialized"); + return !_soft_reference_policy->should_clear_reference(reference, clock); +} + +template +bool ShenandoahReferenceProcessor::should_discover(oop reference, ReferenceType type) const { + T* referent_addr = (T*) java_lang_ref_Reference::referent_addr_raw(reference); + T heap_oop = RawAccess<>::oop_load(referent_addr); + oop referent = CompressedOops::decode_not_null(heap_oop); + + if (is_inactive(reference, referent, type)) { + log_trace(gc,ref)("Reference inactive: " PTR_FORMAT, p2i(reference)); + return false; + } + + if (is_strongly_live(referent)) { + log_trace(gc,ref)("Reference strongly live: " PTR_FORMAT, p2i(reference)); + return false; + } + + if (is_softly_live(reference, type)) { + log_trace(gc,ref)("Reference softly live: " PTR_FORMAT, p2i(reference)); + return false; + } + + return true; +} + +template +bool ShenandoahReferenceProcessor::should_drop(oop reference, ReferenceType type) const { + const oop referent = reference_referent(reference); + if (referent == NULL) { + // Reference has been cleared, by a call to Reference.enqueue() + // or Reference.clear() from the application, which means we + // should drop the reference. + return true; + } + + // Check if the referent is still alive, in which case we should + // drop the reference. + if (type == REF_PHANTOM) { + return ShenandoahHeap::heap()->complete_marking_context()->is_marked(referent); + } else { + return ShenandoahHeap::heap()->complete_marking_context()->is_marked_strong(referent); + } +} + +template +void ShenandoahReferenceProcessor::make_inactive(oop reference, ReferenceType type) const { + if (type == REF_FINAL) { + // Don't clear referent. It is needed by the Finalizer thread to make the call + // to finalize(). A FinalReference is instead made inactive by self-looping the + // next field. An application can't call FinalReference.enqueue(), so there is + // no race to worry about when setting the next field. + assert(reference_next(reference) == NULL, "Already inactive"); + assert(ShenandoahHeap::heap()->marking_context()->is_marked(reference_referent(reference)), "only make inactive final refs with alive referents"); + reference_set_next(reference, reference); + } else { + // Clear referent + reference_set_referent(reference, NULL); + } +} + +template +bool ShenandoahReferenceProcessor::discover(oop reference, ReferenceType type, uint worker_id) { + if (!should_discover(reference, type)) { + // Not discovered + return false; + } + + if (reference_discovered(reference) != NULL) { + // Already discovered. This can happen if the reference is marked finalizable first, and then strong, + // in which case it will be seen 2x by marking. + log_trace(gc,ref)("Reference already discovered: " PTR_FORMAT, p2i(reference)); + return true; + } + + if (type == REF_FINAL) { + ShenandoahMarkRefsSuperClosure* cl = _ref_proc_thread_locals[worker_id].mark_closure(); + bool weak = cl->is_weak(); + cl->set_weak(true); + if (UseCompressedOops) { + cl->do_oop(reinterpret_cast(java_lang_ref_Reference::referent_addr_raw(reference))); + } else { + cl->do_oop(reinterpret_cast(java_lang_ref_Reference::referent_addr_raw(reference))); + } + cl->set_weak(weak); + } + + // Add reference to discovered list + assert(worker_id != ShenandoahThreadLocalData::INVALID_WORKER_ID, "need valid worker ID"); + ShenandoahRefProcThreadLocal& refproc_data = _ref_proc_thread_locals[worker_id]; + oop discovered_head = refproc_data.discovered_list_head(); + if (discovered_head == NULL) { + // Self-loop tail of list. We distinguish discovered from not-discovered references by looking at their + // discovered field: if it is NULL, then it is not-yet discovered, otherwise it is discovered + discovered_head = reference; + } + if (reference_cas_discovered(reference, discovered_head)) { + refproc_data.set_discovered_list_head(reference); + assert(refproc_data.discovered_list_head() == reference, "reference must be new discovered head"); + log_trace(gc, ref)("Discovered Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type)); + _ref_proc_thread_locals[worker_id].inc_discovered(type); + } + return true; +} + +bool ShenandoahReferenceProcessor::discover_reference(oop reference, ReferenceType type) { + if (!RegisterReferences) { + // Reference processing disabled + return false; + } + + log_trace(gc, ref)("Encountered Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type)); + uint worker_id = ShenandoahThreadLocalData::worker_id(Thread::current()); + _ref_proc_thread_locals->inc_encountered(type); + + if (UseCompressedOops) { + return discover(reference, type, worker_id); + } else { + return discover(reference, type, worker_id); + } +} + +template +oop ShenandoahReferenceProcessor::drop(oop reference, ReferenceType type) { + log_trace(gc, ref)("Dropped Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type)); + + assert(reference_referent(reference) == NULL || + ShenandoahHeap::heap()->marking_context()->is_marked(reference_referent(reference)), "only drop references with alive referents"); + + // Unlink and return next in list + oop next = reference_discovered(reference); + reference_set_discovered(reference, NULL); + return next; +} + +template +T* ShenandoahReferenceProcessor::keep(oop reference, ReferenceType type, uint worker_id) { + log_trace(gc, ref)("Enqueued Reference: " PTR_FORMAT " (%s)", p2i(reference), reference_type_name(type)); + + // Update statistics + _ref_proc_thread_locals[worker_id].inc_enqueued(type); + + // Make reference inactive + make_inactive(reference, type); + + // Return next in list + return reference_discovered_addr(reference); +} + +template +void ShenandoahReferenceProcessor::process_references(ShenandoahRefProcThreadLocal& refproc_data, uint worker_id) {; + log_trace(gc, ref)("Processing discovered list #%u : " PTR_FORMAT, worker_id, p2i(refproc_data.discovered_list_head())); + T* list = refproc_data.discovered_list_addr(); + // The list head is basically a GC root, we need to resolve and update it, + // otherwise we will later swap a from-space ref into Universe::pending_list(). + if (!CompressedOops::is_null(*list)) { + oop first_resolved = lrb(CompressedOops::decode_not_null(*list)); + set_oop_field(list, first_resolved); + } + T* p = list; + while (true) { + const oop reference = lrb(CompressedOops::decode(*p)); + if (reference == NULL) { + break; + } + log_trace(gc, ref)("Processing reference: " PTR_FORMAT, p2i(reference)); + const ReferenceType type = reference_type(reference); + + if (should_drop(reference, type)) { + set_oop_field(p, drop(reference, type)); + } else { + p = keep(reference, type, worker_id); + } + + const oop discovered = lrb(reference_discovered(reference)); + if (reference == discovered) { + // Reset terminating self-loop to NULL + reference_set_discovered(reference, oop(NULL)); + break; + } + } + + // Prepend discovered references to internal pending list + if (!CompressedOops::is_null(*list)) { + oop head = lrb(CompressedOops::decode_not_null(*list)); + shenandoah_assert_not_in_cset_except(&head, head, ShenandoahHeap::heap()->cancelled_gc() || !ShenandoahLoadRefBarrier); + oop prev = Atomic::xchg(&_pending_list, head); + RawAccess<>::oop_store(p, prev); + if (prev == NULL) { + // First to prepend to list, record tail + _pending_list_tail = reinterpret_cast(p); + } + + // Clear discovered list + set_oop_field(list, oop(NULL)); + } +} + +void ShenandoahReferenceProcessor::work() { + // Process discovered references + uint max_workers = ShenandoahHeap::heap()->max_workers(); + uint worker_id = Atomic::add(&_iterate_discovered_list_id, 1U) - 1; + while (worker_id < max_workers) { + if (UseCompressedOops) { + process_references(_ref_proc_thread_locals[worker_id], worker_id); + } else { + process_references(_ref_proc_thread_locals[worker_id], worker_id); + } + worker_id = Atomic::add(&_iterate_discovered_list_id, 1U) - 1; + } +} + +class ShenandoahReferenceProcessorTask : public AbstractGangTask { +private: + ShenandoahReferenceProcessor* const _reference_processor; + +public: + ShenandoahReferenceProcessorTask(ShenandoahReferenceProcessor* reference_processor) : + AbstractGangTask("ShenandoahReferenceProcessorTask"), + _reference_processor(reference_processor) { + } + + virtual void work(uint worker_id) { + ShenandoahConcurrentWorkerSession worker_session(worker_id); + _reference_processor->work(); + } +}; + +void ShenandoahReferenceProcessor::process_references(WorkGang* workers, bool concurrent) { + + Atomic::release_store_fence(&_iterate_discovered_list_id, 0U); + + // Process discovered lists + ShenandoahReferenceProcessorTask task(this); + workers->run_task(&task); + + // Update SoftReference clock + soft_reference_update_clock(); + + // Collect, log and trace statistics + collect_statistics(); + + enqueue_references(concurrent); +} + +void ShenandoahReferenceProcessor::enqueue_references_locked() { + // Prepend internal pending list to external pending list + shenandoah_assert_not_in_cset_except(&_pending_list, _pending_list, ShenandoahHeap::heap()->cancelled_gc() || !ShenandoahLoadRefBarrier); + if (UseCompressedOops) { + *reinterpret_cast(_pending_list_tail) = CompressedOops::encode(Universe::swap_reference_pending_list(_pending_list)); + } else { + *reinterpret_cast(_pending_list_tail) = Universe::swap_reference_pending_list(_pending_list); + } +} + +void ShenandoahReferenceProcessor::enqueue_references(bool concurrent) { + if (_pending_list == NULL) { + // Nothing to enqueue + return; + } + + if (!concurrent) { + // When called from mark-compact or degen-GC, the locking is done by the VMOperation, + enqueue_references_locked(); + } else { + // Heap_lock protects external pending list + MonitorLocker ml(Heap_lock, Mutex::_no_safepoint_check_flag); + + enqueue_references_locked(); + + // Notify ReferenceHandler thread + ml.notify_all(); + } + + // Reset internal pending list + _pending_list = NULL; + _pending_list_tail = &_pending_list; +} + +template +void ShenandoahReferenceProcessor::clean_discovered_list(T* list) { + T discovered = *list; + while (!CompressedOops::is_null(discovered)) { + oop discovered_ref = CompressedOops::decode_not_null(discovered); + set_oop_field(list, oop(NULL)); + list = reference_discovered_addr(discovered_ref); + discovered = *list; + } +} + +void ShenandoahReferenceProcessor::abandon_partial_discovery() { + uint max_workers = ShenandoahHeap::heap()->max_workers(); + for (uint index = 0; index < max_workers; index++) { + if (UseCompressedOops) { + clean_discovered_list(_ref_proc_thread_locals[index].discovered_list_addr()); + } else { + clean_discovered_list(_ref_proc_thread_locals[index].discovered_list_addr()); + } + } + if (_pending_list != NULL) { + oop pending = _pending_list; + _pending_list = NULL; + if (UseCompressedOops) { + narrowOop* list = reference_discovered_addr(pending); + clean_discovered_list(list); + } else { + oop* list = reference_discovered_addr(pending); + clean_discovered_list(list); + } + } + _pending_list_tail = &_pending_list; +} + +void ShenandoahReferenceProcessor::collect_statistics() { + Counters encountered = {}; + Counters discovered = {}; + Counters enqueued = {}; + uint max_workers = ShenandoahHeap::heap()->max_workers(); + for (uint i = 0; i < max_workers; i++) { + for (size_t type = 0; type < reference_type_count; type++) { + encountered[type] += _ref_proc_thread_locals[i].encountered((ReferenceType)type); + discovered[type] += _ref_proc_thread_locals[i].discovered((ReferenceType)type); + enqueued[type] += _ref_proc_thread_locals[i].enqueued((ReferenceType)type); + } + } + log_info(gc,ref)("Encountered references: Soft: " SIZE_FORMAT ", Weak: " SIZE_FORMAT ", Final: " SIZE_FORMAT ", Phantom: " SIZE_FORMAT, + encountered[REF_SOFT], encountered[REF_WEAK], encountered[REF_FINAL], encountered[REF_PHANTOM]); + log_info(gc,ref)("Discovered references: Soft: " SIZE_FORMAT ", Weak: " SIZE_FORMAT ", Final: " SIZE_FORMAT ", Phantom: " SIZE_FORMAT, + discovered[REF_SOFT], discovered[REF_WEAK], discovered[REF_FINAL], discovered[REF_PHANTOM]); + log_info(gc,ref)("Enqueued references: Soft: " SIZE_FORMAT ", Weak: " SIZE_FORMAT ", Final: " SIZE_FORMAT ", Phantom: " SIZE_FORMAT, + enqueued[REF_SOFT], enqueued[REF_WEAK], enqueued[REF_FINAL], enqueued[REF_PHANTOM]); +} \ No newline at end of file diff --git a/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp new file mode 100644 index 0000000000000..40dbbc37f6e1f --- /dev/null +++ b/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.hpp @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, Red Hat, Inc. and/or its affiliates. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHREFERENCEPROCESSOR_HPP +#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHREFERENCEPROCESSOR_HPP + +#include "gc/shared/referenceDiscoverer.hpp" +#include "memory/allocation.hpp" + +class ShenandoahMarkRefsSuperClosure; +class WorkGang; + +static const size_t reference_type_count = REF_PHANTOM + 1; +typedef size_t Counters[reference_type_count]; + +/* + * Shenandoah concurrent reference processing + * + * Concurrent reference processing is made up of two main phases: + * 1. Concurrent reference marking: Discover all j.l.r.Reference objects and determine reachability of all live objects. + * 2. Concurrent reference processing: For all discoved j.l.r.References, determine whether to keep them alive or clean + * them. Also, clean and enqueue relevant references concurrently. + * + * Concurrent reference marking: + * The goal here is to establish the kind of reachability for all objects on the heap. We distinguish two kinds of + * reachability: + * - An object is 'strongly reachable' if it can be found by searching transitively from GC roots. + * - An object is 'finalizably reachable' if it is not strongly reachable, but can be found by searching + * from the referents of FinalReferences. + * + * These reachabilities are implemented in shenandoahMarkBitMap.* + * Conceptually, marking starts with a strong wavefront at the GC roots. Whenever a Reference object is encountered, + * it may be discovered by the ShenandoahReferenceProcessor. If it is discovered, it + * gets added to the discovered list, and that wavefront stops there, except when it's a FinalReference, in which + * case the wavefront switches to finalizable marking and marks through the referent. When a Reference is not + * discovered, e.g. if it's a SoftReference that is not eligible for discovery, then marking continues as if the + * Reference was a regular object. Whenever a strong wavefront encounters an object that is already marked + * finalizable, then the object's reachability is upgraded to strong. + * + * Concurrent reference processing: + * This happens after the concurrent marking phase and the final marking pause, when reachability for all objects + * has been established. + * The discovered list is scanned and for each reference is decided what to do: + * - If the referent is reachable (finalizable for PhantomReference, strong for all others), then the Reference + * is dropped from the discovered list and otherwise ignored + * - Otherwise its referent becomes cleared and the Reference added to the pending list, from which it will later + * be processed (e.g. enqueued in its ReferenceQueue) by the Java ReferenceHandler thread. + * + * In order to prevent resurrection by Java threads calling Reference.get() concurrently while we are clearing + * referents, we employ a special barrier, the native LRB, which returns NULL when the referent is unreachable. + */ + +class ShenandoahRefProcThreadLocal : public CHeapObj { +private: + void* _discovered_list; + ShenandoahMarkRefsSuperClosure* _mark_closure; + Counters _encountered_count; + Counters _discovered_count; + Counters _enqueued_count; + +public: + ShenandoahRefProcThreadLocal(); + + ShenandoahRefProcThreadLocal(const ShenandoahRefProcThreadLocal&) = delete; // non construction-copyable + ShenandoahRefProcThreadLocal& operator=(const ShenandoahRefProcThreadLocal&) = delete; // non copyable + + void reset(); + + ShenandoahMarkRefsSuperClosure* mark_closure() const { + return _mark_closure; + } + + void set_mark_closure(ShenandoahMarkRefsSuperClosure* mark_closure) { + _mark_closure = mark_closure; + } + + template + T* discovered_list_addr(); + template + oop discovered_list_head() const; + template + void set_discovered_list_head(oop head); + + size_t encountered(ReferenceType type) const { + return _encountered_count[type]; + } + size_t discovered(ReferenceType type) const { + return _discovered_count[type]; + } + size_t enqueued(ReferenceType type) const { + return _enqueued_count[type]; + } + + void inc_encountered(ReferenceType type) { + _encountered_count[type]++; + } + void inc_discovered(ReferenceType type) { + _discovered_count[type]++; + } + void inc_enqueued(ReferenceType type) { + _enqueued_count[type]++; + } +}; + +class ShenandoahReferenceProcessor : public ReferenceDiscoverer { +private: + ReferencePolicy* _soft_reference_policy; + + ShenandoahRefProcThreadLocal* _ref_proc_thread_locals; + + oop _pending_list; + void* _pending_list_tail; // T* + + volatile uint _iterate_discovered_list_id; + + template + bool is_inactive(oop reference, oop referent, ReferenceType type) const; + bool is_strongly_live(oop referent) const; + bool is_softly_live(oop reference, ReferenceType type) const; + + template + bool should_discover(oop reference, ReferenceType type) const; + template + bool should_drop(oop reference, ReferenceType type) const; + + template + void make_inactive(oop reference, ReferenceType type) const; + + template + bool discover(oop reference, ReferenceType type, uint worker_id); + + template + oop drop(oop reference, ReferenceType type); + template + T* keep(oop reference, ReferenceType type, uint worker_id); + + template + void process_references(ShenandoahRefProcThreadLocal& refproc_data, uint worker_id); + void enqueue_references_locked(); + void enqueue_references(bool concurrent); + + void collect_statistics(); + + template + void clean_discovered_list(T* list); + +public: + ShenandoahReferenceProcessor(uint max_workers); + + void reset_thread_locals(); + void set_mark_closure(uint worker_id, ShenandoahMarkRefsSuperClosure* mark_closure); + + void set_soft_reference_policy(bool clear); + + bool discover_reference(oop obj, ReferenceType type) override; + + void process_references(WorkGang* workers, bool concurrent); + + void work(); + + void abandon_partial_discovery(); +}; + +#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHREFERENCEPROCESSOR_HPP diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp index f56c4d6f54c16..66aed42cdce3d 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp @@ -167,7 +167,6 @@ class ShenandoahConcurrentRootScanner { ShenandoahVMRoots _vm_roots; ShenandoahClassLoaderDataRoots _cld_roots; - ShenandoahConcurrentStringDedupRoots _dedup_roots; ShenandoahNMethodTableSnapshot* _codecache_snapshot; ShenandoahPhaseTimings::Phase _phase; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp index 8e4d077693d82..e92b9fce18102 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.inline.hpp @@ -149,7 +149,6 @@ ShenandoahConcurrentRootScanner::ShenandoahConcurrentRootScanner(uin ShenandoahPhaseTimings::Phase phase) : _vm_roots(phase), _cld_roots(phase, n_workers), - _dedup_roots(phase), _codecache_snapshot(NULL), _phase(phase) { if (!ShenandoahHeap::heap()->unload_classes()) { @@ -180,9 +179,7 @@ void ShenandoahConcurrentRootScanner::oops_do(OopClosure* oops, uint _vm_roots.oops_do(oops, worker_id); if (!heap->unload_classes()) { - AlwaysTrueClosure always_true; _cld_roots.cld_do(&clds_cl, worker_id); - _dedup_roots.oops_do(&always_true, oops, worker_id); ShenandoahWorkerTimingsTracker timer(_phase, ShenandoahPhaseTimings::CodeCacheRoots, worker_id); CodeBlobToOopClosure blobs(oops, !CodeBlobToOopClosure::FixRelocations); _codecache_snapshot->parallel_blobs_do(&blobs); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp index 0176bb9beae5a..0dcba269aad60 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.cpp @@ -133,13 +133,6 @@ void ShenandoahRootVerifier::roots_do(OopClosure* oops) { JNIHandles::oops_do(oops); Universe::vm_global()->oops_do(oops); - AlwaysTrueClosure always_true; - WeakProcessor::weak_oops_do(&always_true, oops); - - if (ShenandoahStringDedup::is_enabled()) { - ShenandoahStringDedup::oops_do_slow(oops); - } - // Do thread roots the last. This allows verification code to find // any broken objects from those special roots first, not the accidental // dangling reference from the thread root. diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp index 69cbdca1f94c2..5fb69eb9b0f65 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp @@ -69,3 +69,7 @@ JRT_END JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_weak(oopDesc * src, oop* load_addr)) return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier(oop(src), load_addr); JRT_END + +JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_weak_narrow(oopDesc * src, narrowOop* load_addr)) + return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier(oop(src), load_addr); +JRT_END diff --git a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp index b42164a3724c6..c0446d3216853 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp @@ -42,6 +42,7 @@ class ShenandoahRuntime : public AllStatic { static oopDesc* load_reference_barrier_narrow(oopDesc* src, narrowOop* load_addr); static oopDesc* load_reference_barrier_weak(oopDesc* src, oop* load_addr); + static oopDesc* load_reference_barrier_weak_narrow(oopDesc* src, narrowOop* load_addr); static void shenandoah_clone_barrier(oopDesc* src); }; diff --git a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp index 40853015a6520..bc38a0936eb48 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp @@ -74,11 +74,15 @@ class BufferedOverflowTaskQueue: public OverflowTaskQueue // that the block has the size of 2^pow. This requires for pow to have only 5 bits (2^32) to encode // all possible arrays. // -// |---------oop---------|-pow-|--chunk---| +// |xx-------oop---------|-pow-|--chunk---| // 0 49 54 64 // // By definition, chunk == 0 means "no chunk", i.e. chunking starts from 1. // +// Lower bits of oop are reserved to handle "skip_live" and "strong" properties. Since this encoding +// stores uncompressed oops, those bits are always available. These bits default to zero for "skip_live" +// and "weak". This aligns with their frequent values: strong/counted-live references. +// // This encoding gives a few interesting benefits: // // a) Encoding/decoding regular oops is very simple, because the upper bits are zero in that task: @@ -145,7 +149,9 @@ class ShenandoahMarkTask static const uint8_t pow_shift = oop_bits; static const uint8_t chunk_shift = oop_bits + pow_bits; - static const uintptr_t oop_extract_mask = right_n_bits(oop_bits); + static const uintptr_t oop_extract_mask = right_n_bits(oop_bits) - 3; + static const uintptr_t skip_live_extract_mask = 1 << 0; + static const uintptr_t weak_extract_mask = 1 << 1; static const uintptr_t chunk_pow_extract_mask = ~right_n_bits(oop_bits); static const int chunk_range_mask = right_n_bits(chunk_bits); @@ -169,9 +175,24 @@ class ShenandoahMarkTask return (int) ((val >> pow_shift) & pow_range_mask); } - inline uintptr_t encode_oop(oop obj) const { + inline bool decode_weak(uintptr_t val) const { + return (val & weak_extract_mask) != 0; + } + + inline bool decode_cnt_live(uintptr_t val) const { + return (val & skip_live_extract_mask) == 0; + } + + inline uintptr_t encode_oop(oop obj, bool skip_live, bool weak) const { STATIC_ASSERT(oop_shift == 0); - return cast_from_oop(obj); + uintptr_t encoded = cast_from_oop(obj); + if (skip_live) { + encoded |= skip_live_extract_mask; + } + if (weak) { + encoded |= weak_extract_mask; + } + return encoded; } inline uintptr_t encode_chunk(int chunk) const { @@ -183,19 +204,23 @@ class ShenandoahMarkTask } public: - ShenandoahMarkTask(oop o = NULL) { - uintptr_t enc = encode_oop(o); - assert(decode_oop(enc) == o, "oop encoding should work: " PTR_FORMAT, p2i(o)); - assert(decode_not_chunked(enc), "task should not be chunked"); + ShenandoahMarkTask(oop o = NULL, bool skip_live = false, bool weak = false) { + uintptr_t enc = encode_oop(o, skip_live, weak); + assert(decode_oop(enc) == o, "oop encoding should work: " PTR_FORMAT, p2i(o)); + assert(decode_cnt_live(enc) == !skip_live, "skip_live encoding should work"); + assert(decode_weak(enc) == weak, "weak encoding should work"); + assert(decode_not_chunked(enc), "task should not be chunked"); _obj = enc; } - ShenandoahMarkTask(oop o, int chunk, int pow) { - uintptr_t enc_oop = encode_oop(o); + ShenandoahMarkTask(oop o, bool skip_live, bool weak, int chunk, int pow) { + uintptr_t enc_oop = encode_oop(o, skip_live, weak); uintptr_t enc_chunk = encode_chunk(chunk); uintptr_t enc_pow = encode_pow(pow); uintptr_t enc = enc_oop | enc_chunk | enc_pow; assert(decode_oop(enc) == o, "oop encoding should work: " PTR_FORMAT, p2i(o)); + assert(decode_cnt_live(enc) == !skip_live, "skip_live should be true for chunked tasks"); + assert(decode_weak(enc) == weak, "weak encoding should work"); assert(decode_chunk(enc) == chunk, "chunk encoding should work: %d", chunk); assert(decode_pow(enc) == pow, "pow encoding should work: %d", pow); assert(!decode_not_chunked(enc), "task should be chunked"); @@ -210,6 +235,8 @@ class ShenandoahMarkTask inline int pow() const { return decode_pow(_obj); } inline bool is_not_chunked() const { return decode_not_chunked(_obj); } + inline bool is_weak() const { return decode_weak(_obj); } + inline bool count_liveness() const { return decode_cnt_live(_obj); } DEBUG_ONLY(bool is_valid() const;) // Tasks to be pushed/popped must be valid. @@ -232,12 +259,14 @@ class ShenandoahMarkTask static const int pow_max = nth_bit(pow_bits) - 1; oop _obj; + bool _skip_live; + bool _weak; int _chunk; int _pow; public: - ShenandoahMarkTask(oop o = NULL, int chunk = 0, int pow = 0): - _obj(o), _chunk(chunk), _pow(pow) { + ShenandoahMarkTask(oop o = NULL, bool skip_live = false, bool weak = false, int chunk = 0, int pow = 0): + _obj(o), _skip_live(skip_live), _weak(weak), _chunk(chunk), _pow(pow) { assert(0 <= chunk && chunk <= chunk_max, "chunk is in range: %d", chunk); assert(0 <= pow && pow <= pow_max, "pow is in range: %d", pow); } @@ -248,6 +277,8 @@ class ShenandoahMarkTask inline int chunk() const { return _chunk; } inline int pow() const { return _pow; } inline bool is_not_chunked() const { return _chunk == 0; } + inline bool is_weak() const { return _weak; } + inline bool count_liveness() const { return !_skip_live; } DEBUG_ONLY(bool is_valid() const;) // Tasks to be pushed/popped must be valid. diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp index 9624d4c5e8a8f..b3a4aef6426d3 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp @@ -59,9 +59,9 @@ class VM_ShenandoahInitMark: public VM_ShenandoahOperation { virtual void doit(); }; -class VM_ShenandoahFinalMarkStartEvac: public VM_ShenandoahReferenceOperation { +class VM_ShenandoahFinalMarkStartEvac: public VM_ShenandoahOperation { public: - VM_ShenandoahFinalMarkStartEvac() : VM_ShenandoahReferenceOperation() {}; + VM_ShenandoahFinalMarkStartEvac() : VM_ShenandoahOperation() {}; VM_Operation::VMOp_Type type() const { return VMOp_ShenandoahFinalMarkStartEvac; } const char* name() const { return "Shenandoah Final Mark and Start Evacuation"; } virtual void doit(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp index 9eb5d43fd3c55..fa464496ec04b 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp @@ -47,6 +47,17 @@ #undef verify_oop #endif +static bool is_instance_ref_klass(Klass* k) { + return k->is_instance_klass() && InstanceKlass::cast(k)->reference_type() != REF_NONE; +} + +class ShenandoahIgnoreReferenceDiscoverer : public ReferenceDiscoverer { +public: + virtual bool discover_reference(oop obj, ReferenceType type) { + return true; + } +}; + class ShenandoahVerifyOopClosure : public BasicOopIterateClosure { private: const char* _phase; @@ -68,7 +79,12 @@ class ShenandoahVerifyOopClosure : public BasicOopIterateClosure { _map(map), _ld(ld), _interior_loc(NULL), - _loc(NULL) { } + _loc(NULL) { + if (options._verify_marked == ShenandoahVerifier::_verify_marked_complete_except_references || + options._verify_marked == ShenandoahVerifier::_verify_marked_disable) { + set_ref_discoverer_internal(new ShenandoahIgnoreReferenceDiscoverer()); + } + } private: void check(ShenandoahAsserts::SafeLevel level, oop obj, bool test, const char* label) { @@ -82,7 +98,9 @@ class ShenandoahVerifyOopClosure : public BasicOopIterateClosure { T o = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(o)) { oop obj = CompressedOops::decode_not_null(o); - + if (is_instance_ref_klass(obj->klass())) { + obj = ShenandoahForwarding::get_forwardee(obj); + } // Single threaded verification can use faster non-atomic stack and bitmap // methods. // @@ -208,6 +226,10 @@ class ShenandoahVerifyOopClosure : public BasicOopIterateClosure { check(ShenandoahAsserts::_safe_all, obj, _heap->complete_marking_context()->is_marked(obj), "Must be marked in complete bitmap"); break; + case ShenandoahVerifier::_verify_marked_complete_except_references: + check(ShenandoahAsserts::_safe_all, obj, _heap->complete_marking_context()->is_marked(obj), + "Must be marked in complete bitmap, except j.l.r.Reference referents"); + break; default: assert(false, "Unhandled mark verification"); } @@ -526,19 +548,19 @@ class ShenandoahVerifierMarkedRegionTask : public AbstractGangTask { virtual void work_regular(ShenandoahHeapRegion *r, ShenandoahVerifierStack &stack, ShenandoahVerifyOopClosure &cl) { size_t processed = 0; - MarkBitMap* mark_bit_map = _heap->complete_marking_context()->mark_bit_map(); - HeapWord* tams = _heap->complete_marking_context()->top_at_mark_start(r); + ShenandoahMarkingContext* ctx = _heap->complete_marking_context(); + HeapWord* tams = ctx->top_at_mark_start(r); // Bitmaps, before TAMS if (tams > r->bottom()) { HeapWord* start = r->bottom(); - HeapWord* addr = mark_bit_map->get_next_marked_addr(start, tams); + HeapWord* addr = ctx->get_next_marked_addr(start, tams); while (addr < tams) { verify_and_follow(addr, stack, cl, &processed); addr += 1; if (addr < tams) { - addr = mark_bit_map->get_next_marked_addr(addr, tams); + addr = ctx->get_next_marked_addr(addr, tams); } } } @@ -566,9 +588,10 @@ class ShenandoahVerifierMarkedRegionTask : public AbstractGangTask { // Verify everything reachable from that object too, hopefully realizing // everything was already marked, and never touching further: - cl.verify_oops_from(obj); - (*processed)++; - + if (!is_instance_ref_klass(obj->klass())) { + cl.verify_oops_from(obj); + (*processed)++; + } while (!stack.is_empty()) { ShenandoahVerifierTask task = stack.pop(); cl.verify_oops_from(task.obj()); @@ -718,7 +741,7 @@ void ShenandoahVerifier::verify_at_safepoint(const char *label, // version size_t count_marked = 0; - if (ShenandoahVerifyLevel >= 4 && marked == _verify_marked_complete) { + if (ShenandoahVerifyLevel >= 4 && (marked == _verify_marked_complete || marked == _verify_marked_complete_except_references)) { guarantee(_heap->marking_context()->is_complete(), "Marking context should be complete"); ShenandoahVerifierMarkedRegionTask task(_verification_bit_map, ld, label, options); _heap->workers()->run_task(&task); @@ -793,11 +816,11 @@ void ShenandoahVerifier::verify_after_concmark() { verify_at_safepoint( "After Mark", _verify_forwarded_none, // no forwarded references - _verify_marked_complete, // bitmaps as precise as we can get + _verify_marked_complete_except_references, // bitmaps as precise as we can get, except dangling j.l.r.Refs _verify_cset_none, // no references to cset anymore _verify_liveness_complete, // liveness data must be complete here _verify_regions_disable, // trash regions not yet recycled - _verify_gcstate_stable, // mark should have stabilized the heap + _verify_gcstate_stable, // mark should have stabilized the heap _verify_all_weak_roots ); } @@ -810,12 +833,12 @@ void ShenandoahVerifier::verify_before_evacuation() { verify_at_safepoint( "Before Evacuation", - _verify_forwarded_none, // no forwarded references - _verify_marked_complete, // walk over marked objects too - _verify_cset_disable, // non-forwarded references to cset expected - _verify_liveness_complete, // liveness data must be complete here - _verify_regions_disable, // trash regions not yet recycled - _verify_gcstate_stable, // mark should have stabilized the heap + _verify_forwarded_none, // no forwarded references + _verify_marked_complete_except_references, // walk over marked objects too + _verify_cset_disable, // non-forwarded references to cset expected + _verify_liveness_complete, // liveness data must be complete here + _verify_regions_disable, // trash regions not yet recycled + _verify_gcstate_stable, // mark should have stabilized the heap verify_weak_roots ); } diff --git a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp index bb5d8ff9708fa..b984471519705 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.hpp @@ -65,7 +65,11 @@ class ShenandoahVerifier : public CHeapObj { _verify_marked_incomplete, // Objects should be marked in "complete" bitmap. - _verify_marked_complete + _verify_marked_complete, + + // Objects should be marked in "complete" bitmap, except j.l.r.Reference referents, which + // may be dangling after marking but before conc-weakrefs-processing. + _verify_marked_complete_except_references } VerifyMarked; typedef enum { diff --git a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp index 54cd8cfcc00fd..867dbc6aa8c7e 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.cpp @@ -32,6 +32,7 @@ uint ShenandoahWorkerPolicy::_prev_par_marking = 0; uint ShenandoahWorkerPolicy::_prev_conc_marking = 0; uint ShenandoahWorkerPolicy::_prev_conc_evac = 0; uint ShenandoahWorkerPolicy::_prev_conc_root_proc = 0; +uint ShenandoahWorkerPolicy::_prev_conc_refs_proc = 0; uint ShenandoahWorkerPolicy::_prev_fullgc = 0; uint ShenandoahWorkerPolicy::_prev_degengc = 0; uint ShenandoahWorkerPolicy::_prev_conc_update_ref = 0; @@ -63,13 +64,23 @@ uint ShenandoahWorkerPolicy::calc_workers_for_final_marking() { return _prev_par_marking; } +// Calculate workers for concurrent refs processing +uint ShenandoahWorkerPolicy::calc_workers_for_conc_refs_processing() { + uint active_workers = (_prev_conc_refs_proc == 0) ? ConcGCThreads : _prev_conc_refs_proc; + _prev_conc_refs_proc = + WorkerPolicy::calc_active_conc_workers(ConcGCThreads, + active_workers, + Threads::number_of_non_daemon_threads()); + return _prev_conc_refs_proc; +} + // Calculate workers for concurrent root processing uint ShenandoahWorkerPolicy::calc_workers_for_conc_root_processing() { uint active_workers = (_prev_conc_root_proc == 0) ? ConcGCThreads : _prev_conc_root_proc; _prev_conc_root_proc = - WorkerPolicy::calc_active_conc_workers(ConcGCThreads, - active_workers, - Threads::number_of_non_daemon_threads()); + WorkerPolicy::calc_active_conc_workers(ConcGCThreads, + active_workers, + Threads::number_of_non_daemon_threads()); return _prev_conc_root_proc; } @@ -123,11 +134,6 @@ uint ShenandoahWorkerPolicy::calc_workers_for_final_update_ref() { return _prev_par_update_ref; } -uint ShenandoahWorkerPolicy::calc_workers_for_conc_preclean() { - // Precleaning is single-threaded - return 1; -} - uint ShenandoahWorkerPolicy::calc_workers_for_conc_cleanup() { uint active_workers = (_prev_conc_cleanup == 0) ? ConcGCThreads : _prev_conc_cleanup; _prev_conc_cleanup = diff --git a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp index 6a7abbd8feffe..10a6fec6535d5 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoahWorkerPolicy.hpp @@ -32,6 +32,7 @@ class ShenandoahWorkerPolicy : AllStatic { static uint _prev_par_marking; static uint _prev_conc_marking; static uint _prev_conc_root_proc; + static uint _prev_conc_refs_proc; static uint _prev_conc_evac; static uint _prev_fullgc; static uint _prev_degengc; @@ -53,6 +54,9 @@ class ShenandoahWorkerPolicy : AllStatic { // Calculate workers for concurrent root processing static uint calc_workers_for_conc_root_processing(); + // Calculate workers for concurrent refs processing + static uint calc_workers_for_conc_refs_processing(); + // Calculate workers for concurrent evacuation (concurrent GC) static uint calc_workers_for_conc_evac(); @@ -68,9 +72,6 @@ class ShenandoahWorkerPolicy : AllStatic { // Calculate workers for parallel/final reference update static uint calc_workers_for_final_update_ref(); - // Calculate workers for concurrent precleaning - static uint calc_workers_for_conc_preclean(); - // Calculate workers for concurrent cleanup static uint calc_workers_for_conc_cleanup(); diff --git a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp index 5417cb5a9fcd1..113e90cb0f3ae 100644 --- a/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp +++ b/src/hotspot/share/gc/shenandoah/shenandoah_globals.hpp @@ -76,13 +76,6 @@ " compact - run GC more frequently and with deeper targets to " \ "free up more memory.") \ \ - product(uintx, ShenandoahRefProcFrequency, 5, EXPERIMENTAL, \ - "Process process weak (soft, phantom, finalizers) references " \ - "every Nth cycle. Normally affects concurrent GC cycles only, " \ - "as degenerated and full GCs would try to process references " \ - "regardless. Set to zero to disable reference processing " \ - "completely.") \ - \ product(uintx, ShenandoahUnloadClassesFrequency, 1, EXPERIMENTAL, \ "Unload the classes every Nth cycle. Normally affects concurrent "\ "GC cycles, as degenerated and full GCs would try to unload " \ @@ -313,11 +306,6 @@ "Forcefully flush non-empty SATB buffers at this interval. " \ "Time is in milliseconds.") \ \ - product(bool, ShenandoahPreclean, true, DIAGNOSTIC, \ - "Do concurrent preclean phase before final mark: process " \ - "definitely alive references to avoid dealing with them during " \ - "pause.") \ - \ product(bool, ShenandoahSuspendibleWorkers, false, EXPERIMENTAL, \ "Suspend concurrent GC worker threads at safepoints") \ \ diff --git a/src/hotspot/share/include/jvm.h b/src/hotspot/share/include/jvm.h index 6e09e076d09c2..35220e2ea6052 100644 --- a/src/hotspot/share/include/jvm.h +++ b/src/hotspot/share/include/jvm.h @@ -330,6 +330,15 @@ JVM_HasReferencePendingList(JNIEnv *env); JNIEXPORT void JNICALL JVM_WaitForReferencePendingList(JNIEnv *env); +JNIEXPORT jboolean JNICALL +JVM_ReferenceRefersTo(JNIEnv *env, jobject ref, jobject o); + +/* + * java.lang.ref.PhantomReference + */ +JNIEXPORT jboolean JNICALL +JVM_PhantomReferenceRefersTo(JNIEnv *env, jobject ref, jobject o); + /* * java.io.ObjectInputStream */ diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index 07d3c0ea0b8a6..efe343bc00697 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -1269,7 +1269,10 @@ JRT_ENTRY(void, InterpreterRuntime::post_method_entry(JavaThread *thread)) JRT_END -JRT_ENTRY(void, InterpreterRuntime::post_method_exit(JavaThread *thread)) +// This is a JRT_BLOCK_ENTRY because we have to stash away the return oop +// before transitioning to VM, and restore it after transitioning back +// to Java. The return oop at the top-of-stack, is not walked by the GC. +JRT_BLOCK_ENTRY(void, InterpreterRuntime::post_method_exit(JavaThread *thread)) LastFrameAccessor last_frame(thread); JvmtiExport::post_method_exit(thread, last_frame.method(), last_frame.get_frame()); JRT_END diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp index eb79ec90d08eb..c39507e872da5 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.cpp @@ -28,7 +28,6 @@ #include "gc/shared/threadLocalAllocBuffer.inline.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/zero/bytecodeInterpreter.inline.hpp" -#include "interpreter/zero/bytecodeInterpreterProfiling.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "logging/log.hpp" @@ -133,17 +132,23 @@ #ifdef PRODUCT #define DO_UPDATE_INSTRUCTION_COUNT(opcode) #else -#define DO_UPDATE_INSTRUCTION_COUNT(opcode) \ -{ \ - BytecodeCounter::_counter_value++; \ - BytecodeHistogram::_counters[(Bytecodes::Code)opcode]++; \ - if (StopInterpreterAt && StopInterpreterAt == BytecodeCounter::_counter_value) os::breakpoint(); \ - if (TraceBytecodes) { \ - CALL_VM((void)InterpreterRuntime::trace_bytecode(THREAD, 0, \ - topOfStack[Interpreter::expr_index_at(1)], \ - topOfStack[Interpreter::expr_index_at(2)]), \ - handle_exception); \ - } \ +#define DO_UPDATE_INSTRUCTION_COUNT(opcode) \ +{ \ + if (PrintBytecodeHistogram) { \ + BytecodeHistogram::_counters[(Bytecodes::Code)opcode]++; \ + } \ + if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) { \ + BytecodeCounter::_counter_value++; \ + if (StopInterpreterAt == BytecodeCounter::_counter_value) { \ + os::breakpoint(); \ + } \ + if (TraceBytecodes) { \ + CALL_VM((void)InterpreterRuntime::trace_bytecode(THREAD, 0, \ + topOfStack[Interpreter::expr_index_at(1)], \ + topOfStack[Interpreter::expr_index_at(2)]), \ + handle_exception); \ + } \ + } \ } #endif @@ -416,8 +421,6 @@ BytecodeInterpreter::run(interpreterState istate) { static bool _jvmti_interp_events = 0; #endif - static int _compiling; // (UseCompiler || CountCompiledCalls) - #ifdef ASSERT if (istate->_msg != initialize) { assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit"); @@ -546,12 +549,12 @@ BytecodeInterpreter::run(interpreterState istate) { topOfStack < istate->stack_base(), "Stack top out of range"); - const uint mdo_last_branch_taken_count = 0; + assert(!UseCompiler, "Zero does not support compilers"); + assert(!CountCompiledCalls, "Zero does not support counting compiled calls"); switch (istate->msg()) { case initialize: { if (initialized++) ShouldNotReachHere(); // Only one initialize call. - _compiling = (UseCompiler || CountCompiledCalls); #ifdef VM_JVMTI _jvmti_interp_events = JvmtiExport::can_post_interpreter_events(); #endif @@ -562,11 +565,6 @@ BytecodeInterpreter::run(interpreterState istate) { THREAD->set_do_not_unlock(); // count invocations assert(initialized, "Interpreter not initialized"); - if (_compiling) { - // Get or create profile data. Check for pending (async) exceptions. - BI_PROFILE_GET_OR_CREATE_METHOD_DATA(handle_exception); - SAFEPOINT; - } if ((istate->_stack_base - istate->_stack_limit) != istate->method()->max_stack() + 1) { // initialize @@ -689,12 +687,6 @@ BytecodeInterpreter::run(interpreterState istate) { // clear the message so we don't confuse ourselves later assert(THREAD->pop_frame_in_process(), "wrong frame pop state"); istate->set_msg(no_request); - if (_compiling) { - // Set MDX back to the ProfileData of the invoke bytecode that will be - // restarted. - SET_MDX(NULL); - BI_PROFILE_GET_OR_CREATE_METHOD_DATA(handle_exception); - } THREAD->clr_pop_frame_in_process(); goto run; } @@ -716,11 +708,6 @@ BytecodeInterpreter::run(interpreterState istate) { if (THREAD->has_pending_exception()) goto handle_exception; // Update the pc by the saved amount of the invoke bytecode size UPDATE_PC(istate->bcp_advance()); - - if (_compiling) { - // Get or create profile data. Check for pending (async) exceptions. - BI_PROFILE_GET_OR_CREATE_METHOD_DATA(handle_exception); - } goto run; } @@ -728,11 +715,6 @@ BytecodeInterpreter::run(interpreterState istate) { // Returned from an opcode that will reexecute. Deopt was // a result of a PopFrame request. // - - if (_compiling) { - // Get or create profile data. Check for pending (async) exceptions. - BI_PROFILE_GET_OR_CREATE_METHOD_DATA(handle_exception); - } goto run; } @@ -755,11 +737,6 @@ BytecodeInterpreter::run(interpreterState istate) { } UPDATE_PC(Bytecodes::length_at(METHOD, pc)); if (THREAD->has_pending_exception()) goto handle_exception; - - if (_compiling) { - // Get or create profile data. Check for pending (async) exceptions. - BI_PROFILE_GET_OR_CREATE_METHOD_DATA(handle_exception); - } goto run; } case got_monitors: { @@ -1058,9 +1035,6 @@ BytecodeInterpreter::run(interpreterState istate) { UPDATE_PC_AND_CONTINUE(6); } case Bytecodes::_ret: - // Profile ret. - BI_PROFILE_UPDATE_RET(/*bci=*/((int)(intptr_t)(LOCALS_ADDR(reg)))); - // Now, update the pc. pc = istate->method()->code_base() + (intptr_t)(LOCALS_ADDR(reg)); UPDATE_PC_AND_CONTINUE(0); default: @@ -1370,23 +1344,17 @@ BytecodeInterpreter::run(interpreterState istate) { #define COMPARISON_OP(name, comparison) \ CASE(_if_icmp##name): { \ - const bool cmp = (STACK_INT(-2) comparison STACK_INT(-1)); \ - int skip = cmp \ + int skip = (STACK_INT(-2) comparison STACK_INT(-1)) \ ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \ address branch_pc = pc; \ - /* Profile branch. */ \ - BI_PROFILE_UPDATE_BRANCH(/*is_taken=*/cmp); \ UPDATE_PC_AND_TOS(skip, -2); \ DO_BACKEDGE_CHECKS(skip, branch_pc); \ CONTINUE; \ } \ CASE(_if##name): { \ - const bool cmp = (STACK_INT(-1) comparison 0); \ - int skip = cmp \ + int skip = (STACK_INT(-1) comparison 0) \ ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \ address branch_pc = pc; \ - /* Profile branch. */ \ - BI_PROFILE_UPDATE_BRANCH(/*is_taken=*/cmp); \ UPDATE_PC_AND_TOS(skip, -1); \ DO_BACKEDGE_CHECKS(skip, branch_pc); \ CONTINUE; \ @@ -1395,12 +1363,9 @@ BytecodeInterpreter::run(interpreterState istate) { #define COMPARISON_OP2(name, comparison) \ COMPARISON_OP(name, comparison) \ CASE(_if_acmp##name): { \ - const bool cmp = (STACK_OBJECT(-2) comparison STACK_OBJECT(-1)); \ - int skip = cmp \ + int skip = (STACK_OBJECT(-2) comparison STACK_OBJECT(-1)) \ ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \ address branch_pc = pc; \ - /* Profile branch. */ \ - BI_PROFILE_UPDATE_BRANCH(/*is_taken=*/cmp); \ UPDATE_PC_AND_TOS(skip, -2); \ DO_BACKEDGE_CHECKS(skip, branch_pc); \ CONTINUE; \ @@ -1408,12 +1373,9 @@ BytecodeInterpreter::run(interpreterState istate) { #define NULL_COMPARISON_NOT_OP(name) \ CASE(_if##name): { \ - const bool cmp = (!(STACK_OBJECT(-1) == NULL)); \ - int skip = cmp \ + int skip = (!(STACK_OBJECT(-1) == NULL)) \ ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \ address branch_pc = pc; \ - /* Profile branch. */ \ - BI_PROFILE_UPDATE_BRANCH(/*is_taken=*/cmp); \ UPDATE_PC_AND_TOS(skip, -1); \ DO_BACKEDGE_CHECKS(skip, branch_pc); \ CONTINUE; \ @@ -1421,12 +1383,9 @@ BytecodeInterpreter::run(interpreterState istate) { #define NULL_COMPARISON_OP(name) \ CASE(_if##name): { \ - const bool cmp = ((STACK_OBJECT(-1) == NULL)); \ - int skip = cmp \ + int skip = ((STACK_OBJECT(-1) == NULL)) \ ? (int16_t)Bytes::get_Java_u2(pc + 1) : 3; \ address branch_pc = pc; \ - /* Profile branch. */ \ - BI_PROFILE_UPDATE_BRANCH(/*is_taken=*/cmp); \ UPDATE_PC_AND_TOS(skip, -1); \ DO_BACKEDGE_CHECKS(skip, branch_pc); \ CONTINUE; \ @@ -1450,13 +1409,10 @@ BytecodeInterpreter::run(interpreterState istate) { int32_t skip; key -= low; if (((uint32_t) key > (uint32_t)(high - low))) { - key = -1; skip = Bytes::get_Java_u4((address)&lpc[0]); } else { skip = Bytes::get_Java_u4((address)&lpc[key + 3]); } - // Profile switch. - BI_PROFILE_UPDATE_SWITCH(/*switch_index=*/key); // Does this really need a full backedge check (osr)? address branch_pc = pc; UPDATE_PC_AND_TOS(skip, -1); @@ -1470,21 +1426,14 @@ BytecodeInterpreter::run(interpreterState istate) { jint* lpc = (jint*)VMalignWordUp(pc+1); int32_t key = STACK_INT(-1); int32_t skip = Bytes::get_Java_u4((address) lpc); /* default amount */ - // Remember index. - int index = -1; - int newindex = 0; int32_t npairs = Bytes::get_Java_u4((address) &lpc[1]); while (--npairs >= 0) { lpc += 2; if (key == (int32_t)Bytes::get_Java_u4((address)lpc)) { skip = Bytes::get_Java_u4((address)&lpc[1]); - index = newindex; break; } - newindex += 1; } - // Profile switch. - BI_PROFILE_UPDATE_SWITCH(/*switch_index=*/index); address branch_pc = pc; UPDATE_PC_AND_TOS(skip, -1); DO_BACKEDGE_CHECKS(skip, branch_pc); @@ -1650,15 +1599,8 @@ BytecodeInterpreter::run(interpreterState istate) { // Seems way more expensive now that we must dispatch // if (rhsKlass != elemKlass && !rhsKlass->is_subtype_of(elemKlass)) { // ebx->is... - // Decrement counter if subtype check failed. - BI_PROFILE_SUBTYPECHECK_FAILED(rhsKlass); VM_JAVA_ERROR(vmSymbols::java_lang_ArrayStoreException(), ""); } - // Profile checkcast with null_seen and receiver. - BI_PROFILE_UPDATE_CHECKCAST(/*null_seen=*/false, rhsKlass); - } else { - // Profile checkcast with null_seen and receiver. - BI_PROFILE_UPDATE_CHECKCAST(/*null_seen=*/true, NULL); } ((objArrayOop) arrObj)->obj_at_put(index, rhsObject); UPDATE_PC_AND_TOS_AND_CONTINUE(1, -3); @@ -2169,26 +2111,17 @@ BytecodeInterpreter::run(interpreterState istate) { // Seems way more expensive now that we must dispatch. // if (objKlass != klassOf && !objKlass->is_subtype_of(klassOf)) { - // Decrement counter at checkcast. - BI_PROFILE_SUBTYPECHECK_FAILED(objKlass); ResourceMark rm(THREAD); char* message = SharedRuntime::generate_class_cast_message( objKlass, klassOf); VM_JAVA_ERROR(vmSymbols::java_lang_ClassCastException(), message); } - // Profile checkcast with null_seen and receiver. - BI_PROFILE_UPDATE_CHECKCAST(/*null_seen=*/false, objKlass); - } else { - // Profile checkcast with null_seen and receiver. - BI_PROFILE_UPDATE_CHECKCAST(/*null_seen=*/true, NULL); } UPDATE_PC_AND_CONTINUE(3); CASE(_instanceof): if (STACK_OBJECT(-1) == NULL) { SET_STACK_INT(0, -1); - // Profile instanceof with null_seen and receiver. - BI_PROFILE_UPDATE_INSTANCEOF(/*null_seen=*/true, NULL); } else { VERIFY_OOP(STACK_OBJECT(-1)); u2 index = Bytes::get_Java_u2(pc+1); @@ -2207,11 +2140,7 @@ BytecodeInterpreter::run(interpreterState istate) { SET_STACK_INT(1, -1); } else { SET_STACK_INT(0, -1); - // Decrement counter at checkcast. - BI_PROFILE_SUBTYPECHECK_FAILED(objKlass); } - // Profile instanceof with null_seen and receiver. - BI_PROFILE_UPDATE_INSTANCEOF(/*null_seen=*/false, objKlass); } UPDATE_PC_AND_CONTINUE(3); @@ -2388,9 +2317,6 @@ BytecodeInterpreter::run(interpreterState istate) { istate->set_callee_entry_point(method->from_interpreted_entry()); istate->set_bcp_advance(5); - // Invokedynamic has got a call counter, just like an invokestatic -> increment! - BI_PROFILE_UPDATE_CALL(); - UPDATE_PC_AND_RETURN(0); // I'll be back... } @@ -2419,9 +2345,6 @@ BytecodeInterpreter::run(interpreterState istate) { istate->set_callee_entry_point(method->from_interpreted_entry()); istate->set_bcp_advance(3); - // Invokehandle has got a call counter, just like a final call -> increment! - BI_PROFILE_UPDATE_FINALCALL(); - UPDATE_PC_AND_RETURN(0); // I'll be back... } @@ -2447,8 +2370,6 @@ BytecodeInterpreter::run(interpreterState istate) { CHECK_NULL(STACK_OBJECT(-(cache->parameter_size()))); if (cache->is_vfinal()) { callee = cache->f2_as_vfinal_method(); - // Profile 'special case of invokeinterface' final call. - BI_PROFILE_UPDATE_FINALCALL(); } else { // Get receiver. int parms = cache->parameter_size(); @@ -2457,8 +2378,6 @@ BytecodeInterpreter::run(interpreterState istate) { VERIFY_OOP(rcvr); Klass* rcvrKlass = rcvr->klass(); callee = (Method*) rcvrKlass->method_at_vtable(cache->f2_as_index()); - // Profile 'special case of invokeinterface' virtual call. - BI_PROFILE_UPDATE_VIRTUALCALL(rcvrKlass); } } else if (cache->is_vfinal()) { // private interface method invocations @@ -2545,9 +2464,6 @@ BytecodeInterpreter::run(interpreterState istate) { handle_exception); } - // Profile virtual call. - BI_PROFILE_UPDATE_VIRTUALCALL(rcvr->klass()); - istate->set_callee(callee); istate->set_callee_entry_point(callee->from_interpreted_entry()); #ifdef VM_JVMTI @@ -2581,8 +2497,6 @@ BytecodeInterpreter::run(interpreterState istate) { CHECK_NULL(STACK_OBJECT(-(cache->parameter_size()))); if (cache->is_vfinal()) { callee = cache->f2_as_vfinal_method(); - // Profile final call. - BI_PROFILE_UPDATE_FINALCALL(); } else { // get receiver int parms = cache->parameter_size(); @@ -2612,17 +2526,12 @@ BytecodeInterpreter::run(interpreterState istate) { Because vtables have the same offset for ArrayKlass and InstanceKlass. */ callee = (Method*) rcvrKlass->method_at_vtable(cache->f2_as_index()); - // Profile virtual call. - BI_PROFILE_UPDATE_VIRTUALCALL(rcvrKlass); } } else { if ((Bytecodes::Code)opcode == Bytecodes::_invokespecial) { CHECK_NULL(STACK_OBJECT(-(cache->parameter_size()))); } callee = cache->f1_as_method(); - - // Profile call. - BI_PROFILE_UPDATE_CALL(); } istate->set_callee(callee); @@ -2677,8 +2586,6 @@ BytecodeInterpreter::run(interpreterState istate) { CASE(_goto): { int16_t offset = (int16_t)Bytes::get_Java_u2(pc + 1); - // Profile jump. - BI_PROFILE_UPDATE_JUMP(); address branch_pc = pc; UPDATE_PC(offset); DO_BACKEDGE_CHECKS(offset, branch_pc); @@ -2695,8 +2602,6 @@ BytecodeInterpreter::run(interpreterState istate) { CASE(_goto_w): { int32_t offset = Bytes::get_Java_u4(pc + 1); - // Profile jump. - BI_PROFILE_UPDATE_JUMP(); address branch_pc = pc; UPDATE_PC(offset); DO_BACKEDGE_CHECKS(offset, branch_pc); @@ -2706,9 +2611,6 @@ BytecodeInterpreter::run(interpreterState istate) { /* return from a jsr or jsr_w */ CASE(_ret): { - // Profile ret. - BI_PROFILE_UPDATE_RET(/*bci=*/((int)(intptr_t)(LOCALS_ADDR(pc[1])))); - // Now, update the pc. pc = istate->method()->code_base() + (intptr_t)(LOCALS_ADDR(pc[1])); UPDATE_PC_AND_CONTINUE(0); } @@ -2791,9 +2693,6 @@ BytecodeInterpreter::run(interpreterState istate) { } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); - - // Update profiling data. - BI_PROFILE_ALIGN_TO_CURRENT_BCI(); goto run; } if (log_is_enabled(Info, exceptions)) { @@ -3150,151 +3049,12 @@ BytecodeInterpreter::BytecodeInterpreter(messages msg) { _prev_link = NULL; } -// Inline static functions for Java Stack and Local manipulation - -// The implementations are platform dependent. We have to worry about alignment -// issues on some machines which can change on the same platform depending on -// whether it is an LP64 machine also. -address BytecodeInterpreter::stack_slot(intptr_t *tos, int offset) { - return (address) tos[Interpreter::expr_index_at(-offset)]; -} - -jint BytecodeInterpreter::stack_int(intptr_t *tos, int offset) { - return *((jint*) &tos[Interpreter::expr_index_at(-offset)]); -} - -jfloat BytecodeInterpreter::stack_float(intptr_t *tos, int offset) { - return *((jfloat *) &tos[Interpreter::expr_index_at(-offset)]); -} - -oop BytecodeInterpreter::stack_object(intptr_t *tos, int offset) { - return cast_to_oop(tos [Interpreter::expr_index_at(-offset)]); -} - -jdouble BytecodeInterpreter::stack_double(intptr_t *tos, int offset) { - return ((VMJavaVal64*) &tos[Interpreter::expr_index_at(-offset)])->d; -} - -jlong BytecodeInterpreter::stack_long(intptr_t *tos, int offset) { - return ((VMJavaVal64 *) &tos[Interpreter::expr_index_at(-offset)])->l; -} - -// only used for value types -void BytecodeInterpreter::set_stack_slot(intptr_t *tos, address value, - int offset) { - *((address *)&tos[Interpreter::expr_index_at(-offset)]) = value; -} - -void BytecodeInterpreter::set_stack_int(intptr_t *tos, int value, - int offset) { - *((jint *)&tos[Interpreter::expr_index_at(-offset)]) = value; -} - -void BytecodeInterpreter::set_stack_float(intptr_t *tos, jfloat value, - int offset) { - *((jfloat *)&tos[Interpreter::expr_index_at(-offset)]) = value; -} - -void BytecodeInterpreter::set_stack_object(intptr_t *tos, oop value, - int offset) { - *((oop *)&tos[Interpreter::expr_index_at(-offset)]) = value; -} - -// needs to be platform dep for the 32 bit platforms. -void BytecodeInterpreter::set_stack_double(intptr_t *tos, jdouble value, - int offset) { - ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset)])->d = value; -} - -void BytecodeInterpreter::set_stack_double_from_addr(intptr_t *tos, - address addr, int offset) { - (((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset)])->d = - ((VMJavaVal64*)addr)->d); -} - -void BytecodeInterpreter::set_stack_long(intptr_t *tos, jlong value, - int offset) { - ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset+1)])->l = 0xdeedbeeb; - ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset)])->l = value; -} - -void BytecodeInterpreter::set_stack_long_from_addr(intptr_t *tos, - address addr, int offset) { - ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset+1)])->l = 0xdeedbeeb; - ((VMJavaVal64*)&tos[Interpreter::expr_index_at(-offset)])->l = - ((VMJavaVal64*)addr)->l; -} - -// Locals - -address BytecodeInterpreter::locals_slot(intptr_t* locals, int offset) { - return (address)locals[Interpreter::local_index_at(-offset)]; -} -jint BytecodeInterpreter::locals_int(intptr_t* locals, int offset) { - return (jint)locals[Interpreter::local_index_at(-offset)]; -} -jfloat BytecodeInterpreter::locals_float(intptr_t* locals, int offset) { - return (jfloat)locals[Interpreter::local_index_at(-offset)]; -} -oop BytecodeInterpreter::locals_object(intptr_t* locals, int offset) { - return cast_to_oop(locals[Interpreter::local_index_at(-offset)]); -} -jdouble BytecodeInterpreter::locals_double(intptr_t* locals, int offset) { - return ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->d; -} -jlong BytecodeInterpreter::locals_long(intptr_t* locals, int offset) { - return ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->l; -} - -// Returns the address of locals value. -address BytecodeInterpreter::locals_long_at(intptr_t* locals, int offset) { - return ((address)&locals[Interpreter::local_index_at(-(offset+1))]); -} -address BytecodeInterpreter::locals_double_at(intptr_t* locals, int offset) { - return ((address)&locals[Interpreter::local_index_at(-(offset+1))]); -} - -// Used for local value or returnAddress -void BytecodeInterpreter::set_locals_slot(intptr_t *locals, - address value, int offset) { - *((address*)&locals[Interpreter::local_index_at(-offset)]) = value; -} -void BytecodeInterpreter::set_locals_int(intptr_t *locals, - jint value, int offset) { - *((jint *)&locals[Interpreter::local_index_at(-offset)]) = value; -} -void BytecodeInterpreter::set_locals_float(intptr_t *locals, - jfloat value, int offset) { - *((jfloat *)&locals[Interpreter::local_index_at(-offset)]) = value; -} -void BytecodeInterpreter::set_locals_object(intptr_t *locals, - oop value, int offset) { - *((oop *)&locals[Interpreter::local_index_at(-offset)]) = value; -} -void BytecodeInterpreter::set_locals_double(intptr_t *locals, - jdouble value, int offset) { - ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->d = value; -} -void BytecodeInterpreter::set_locals_long(intptr_t *locals, - jlong value, int offset) { - ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->l = value; -} -void BytecodeInterpreter::set_locals_double_from_addr(intptr_t *locals, - address addr, int offset) { - ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->d = ((VMJavaVal64*)addr)->d; -} -void BytecodeInterpreter::set_locals_long_from_addr(intptr_t *locals, - address addr, int offset) { - ((VMJavaVal64*)&locals[Interpreter::local_index_at(-(offset+1))])->l = ((VMJavaVal64*)addr)->l; -} - void BytecodeInterpreter::astore(intptr_t* tos, int stack_offset, intptr_t* locals, int locals_offset) { intptr_t value = tos[Interpreter::expr_index_at(-stack_offset)]; locals[Interpreter::local_index_at(-locals_offset)] = value; } - void BytecodeInterpreter::copy_stack_slot(intptr_t *tos, int from_offset, int to_offset) { tos[Interpreter::expr_index_at(-to_offset)] = @@ -3304,6 +3064,7 @@ void BytecodeInterpreter::copy_stack_slot(intptr_t *tos, int from_offset, void BytecodeInterpreter::dup(intptr_t *tos) { copy_stack_slot(tos, -1, 0); } + void BytecodeInterpreter::dup2(intptr_t *tos) { copy_stack_slot(tos, -2, 0); copy_stack_slot(tos, -1, 1); @@ -3387,7 +3148,6 @@ BytecodeInterpreter::print() { char *method_name = _method->name_and_sig_as_C_string(); tty->print_cr("method: " INTPTR_FORMAT "[ %s ]", (uintptr_t) this->_method, method_name); } - tty->print_cr("mdx: " INTPTR_FORMAT, (uintptr_t) this->_mdx); tty->print_cr("stack: " INTPTR_FORMAT, (uintptr_t) this->_stack); tty->print_cr("msg: %s", C_msg(this->_msg)); tty->print_cr("result_to_call._callee: " INTPTR_FORMAT, (uintptr_t) this->_result._to_call._callee); diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp index 2d6f86c1f4fa2..8ff3575c69de8 100644 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp +++ b/src/hotspot/share/interpreter/zero/bytecodeInterpreter.hpp @@ -26,7 +26,6 @@ #define SHARE_INTERPRETER_BYTECODEINTERPRETER_HPP #include "memory/allocation.hpp" -#include "oops/methodData.hpp" #include "oops/method.hpp" #include "runtime/basicLock.hpp" #include "runtime/frame.hpp" @@ -110,7 +109,6 @@ friend class VMStructs; ConstantPoolCache* _constants; // constant pool cache Method* _method; // method being executed oop _mirror; // mirror to klass containing method - DataLayout* _mdx; // compiler profiling data for current bytecode intptr_t* _stack; // expression stack messages _msg; // frame manager <-> interpreter message frame_manager_message _result; // result to frame manager @@ -188,8 +186,6 @@ inline intptr_t* locals() { return _locals; } inline ConstantPoolCache* constants() { return _constants; } inline Method* method() { return _method; } -inline DataLayout* mdx() { return _mdx; } -inline void set_mdx(DataLayout *new_mdx) { _mdx = new_mdx; } inline messages msg() { return _msg; } inline void set_msg(messages new_msg) { _msg = new_msg; } @@ -513,52 +509,6 @@ static void swap(intptr_t *tos); /* swap top two elements */ static void run(interpreterState istate); // The interpreter used if JVMTI needs interpreter events static void runWithChecks(interpreterState istate); -static void End_Of_Interpreter(void); - -// Inline static functions for Java Stack and Local manipulation - -static address stack_slot(intptr_t *tos, int offset); -static jint stack_int(intptr_t *tos, int offset); -static jfloat stack_float(intptr_t *tos, int offset); -static oop stack_object(intptr_t *tos, int offset); -static jdouble stack_double(intptr_t *tos, int offset); -static jlong stack_long(intptr_t *tos, int offset); - -// only used for value types -static void set_stack_slot(intptr_t *tos, address value, int offset); -static void set_stack_int(intptr_t *tos, int value, int offset); -static void set_stack_float(intptr_t *tos, jfloat value, int offset); -static void set_stack_object(intptr_t *tos, oop value, int offset); - -// needs to be platform dep for the 32 bit platforms. -static void set_stack_double(intptr_t *tos, jdouble value, int offset); -static void set_stack_long(intptr_t *tos, jlong value, int offset); - -static void set_stack_double_from_addr(intptr_t *tos, address addr, int offset); -static void set_stack_long_from_addr(intptr_t *tos, address addr, int offset); - -// Locals - -static address locals_slot(intptr_t* locals, int offset); -static jint locals_int(intptr_t* locals, int offset); -static jfloat locals_float(intptr_t* locals, int offset); -static oop locals_object(intptr_t* locals, int offset); -static jdouble locals_double(intptr_t* locals, int offset); -static jlong locals_long(intptr_t* locals, int offset); - -static address locals_long_at(intptr_t* locals, int offset); -static address locals_double_at(intptr_t* locals, int offset); - -static void set_locals_slot(intptr_t *locals, address value, int offset); -static void set_locals_int(intptr_t *locals, jint value, int offset); -static void set_locals_float(intptr_t *locals, jfloat value, int offset); -static void set_locals_object(intptr_t *locals, oop value, int offset); -static void set_locals_double(intptr_t *locals, jdouble value, int offset); -static void set_locals_long(intptr_t *locals, jlong value, int offset); -static void set_locals_double_from_addr(intptr_t *locals, - address addr, int offset); -static void set_locals_long_from_addr(intptr_t *locals, - address addr, int offset); static void astore(intptr_t* topOfStack, int stack_offset, intptr_t* locals, int locals_offset); diff --git a/src/hotspot/share/interpreter/zero/bytecodeInterpreterProfiling.hpp b/src/hotspot/share/interpreter/zero/bytecodeInterpreterProfiling.hpp deleted file mode 100644 index 49e8d4756fdc4..0000000000000 --- a/src/hotspot/share/interpreter/zero/bytecodeInterpreterProfiling.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 SAP SE. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -// This file defines a set of macros which are used by the c++-interpreter -// for updating a method's methodData object. - - -#ifndef SHARE_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP -#define SHARE_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP - -// Empty dummy implementations if profiling code is switched off. ////////////// - -#define SET_MDX(mdx) - -#define BI_PROFILE_GET_OR_CREATE_METHOD_DATA(exception_handler) \ - if (ProfileInterpreter) { \ - ShouldNotReachHere(); \ - } - -#define BI_PROFILE_ALIGN_TO_CURRENT_BCI() - -#define BI_PROFILE_UPDATE_JUMP() -#define BI_PROFILE_UPDATE_BRANCH(is_taken) -#define BI_PROFILE_UPDATE_RET(bci) -#define BI_PROFILE_SUBTYPECHECK_FAILED(receiver) -#define BI_PROFILE_UPDATE_CHECKCAST(null_seen, receiver) -#define BI_PROFILE_UPDATE_INSTANCEOF(null_seen, receiver) -#define BI_PROFILE_UPDATE_CALL() -#define BI_PROFILE_UPDATE_FINALCALL() -#define BI_PROFILE_UPDATE_VIRTUALCALL(receiver) -#define BI_PROFILE_UPDATE_SWITCH(switch_index) - -#endif // SHARE_INTERPRETER_BYTECODEINTERPRETERPROFILING_HPP diff --git a/src/hotspot/share/logging/logTag.hpp b/src/hotspot/share/logging/logTag.hpp index da0070d18afd0..e2d92ce20de99 100644 --- a/src/hotspot/share/logging/logTag.hpp +++ b/src/hotspot/share/logging/logTag.hpp @@ -95,6 +95,7 @@ LOG_TAG(jit) \ LOG_TAG(jni) \ LOG_TAG(jvmti) \ + LOG_TAG(lambda) \ LOG_TAG(library) \ LOG_TAG(liveness) \ LOG_TAG(load) /* Trace all classes loaded */ \ diff --git a/src/hotspot/share/memory/archiveUtils.cpp b/src/hotspot/share/memory/archiveUtils.cpp index dbf9960d99d83..4474519fd7203 100644 --- a/src/hotspot/share/memory/archiveUtils.cpp +++ b/src/hotspot/share/memory/archiveUtils.cpp @@ -323,8 +323,8 @@ void ArchiveUtils::log_to_classlist(BootstrapInfo* bootstrap_specifier, TRAPS) { void ArchiveUtils::check_for_oom(oop exception) { assert(exception != nullptr, "Sanity check"); if (exception->is_a(SystemDictionary::OutOfMemoryError_klass())) { - vm_exit_during_cds_dumping( - err_msg("Out of memory. Please run with a larger Java heap, current MaxHeapSize = " SIZE_FORMAT "M", - MaxHeapSize/M)); + vm_direct_exit(-1, + err_msg("Out of memory. Please run with a larger Java heap, current MaxHeapSize = " + SIZE_FORMAT "M", MaxHeapSize/M)); } } diff --git a/src/hotspot/share/memory/heapShared.cpp b/src/hotspot/share/memory/heapShared.cpp index fafbdaac5270d..d7b016f3fef67 100644 --- a/src/hotspot/share/memory/heapShared.cpp +++ b/src/hotspot/share/memory/heapShared.cpp @@ -206,7 +206,9 @@ oop HeapShared::archive_heap_object(oop obj, Thread* THREAD) { log_error(cds, heap)( "Cannot allocate space for object " PTR_FORMAT " in archived heap region", p2i(obj)); - vm_exit(1); + vm_direct_exit(-1, + err_msg("Out of memory. Please run with a larger Java heap, current MaxHeapSize = " + SIZE_FORMAT "M", MaxHeapSize/M)); } return archived_oop; } @@ -725,7 +727,7 @@ oop HeapShared::archive_reachable_objects_from(int level, // these objects that are referenced (directly or indirectly) by static fields. ResourceMark rm; log_error(cds, heap)("Cannot archive object of class %s", orig_obj->klass()->external_name()); - vm_exit(1); + vm_direct_exit(1); } // java.lang.Class instances cannot be included in an archived object sub-graph. We only support @@ -735,7 +737,7 @@ oop HeapShared::archive_reachable_objects_from(int level, // object that is referenced (directly or indirectly) by static fields. if (java_lang_Class::is_instance(orig_obj)) { log_error(cds, heap)("(%d) Unknown java.lang.Class object is in the archived sub-graph", level); - vm_exit(1); + vm_direct_exit(1); } oop archived_obj = find_archived_heap_object(orig_obj); @@ -771,7 +773,7 @@ oop HeapShared::archive_reachable_objects_from(int level, // We don't know how to handle an object that has been archived, but some of its reachable // objects cannot be archived. Bail out for now. We might need to fix this in the future if // we have a real use case. - vm_exit(1); + vm_direct_exit(1); } } @@ -1031,7 +1033,7 @@ void HeapShared::init_subgraph_entry_fields(ArchivableStaticFieldInfo fields[], ArchiveUtils::check_for_oom(PENDING_EXCEPTION); // exit on OOM log_info(cds)("%s: %s", PENDING_EXCEPTION->klass()->external_name(), java_lang_String::as_utf8_string(java_lang_Throwable::message(PENDING_EXCEPTION))); - vm_exit_during_initialization("VM exits due to exception, use -Xlog:cds,exceptions=trace for detail"); + vm_direct_exit(-1, "VM exits due to exception, use -Xlog:cds,exceptions=trace for detail"); } InstanceKlass* ik = InstanceKlass::cast(k); assert(InstanceKlass::cast(ik)->is_shared_boot_class(), diff --git a/src/hotspot/share/oops/instanceRefKlass.cpp b/src/hotspot/share/oops/instanceRefKlass.cpp index b8de138d59e55..4b30a8edfe6a0 100644 --- a/src/hotspot/share/oops/instanceRefKlass.cpp +++ b/src/hotspot/share/oops/instanceRefKlass.cpp @@ -79,7 +79,7 @@ void InstanceRefKlass::update_nonstatic_oop_maps(Klass* k) { void InstanceRefKlass::oop_verify_on(oop obj, outputStream* st) { InstanceKlass::oop_verify_on(obj, st); // Verify referent field - oop referent = java_lang_ref_Reference::referent(obj); + oop referent = java_lang_ref_Reference::unknown_referent_no_keepalive(obj); if (referent != NULL) { guarantee(oopDesc::is_oop(referent), "referent field heap failed"); } diff --git a/src/hotspot/share/opto/arraycopynode.cpp b/src/hotspot/share/opto/arraycopynode.cpp index d73b2634cf01b..9d9b21ae95d16 100644 --- a/src/hotspot/share/opto/arraycopynode.cpp +++ b/src/hotspot/share/opto/arraycopynode.cpp @@ -183,7 +183,7 @@ Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int c const Type* src_type = phase->type(base_src); - MergeMemNode* mem = MergeMemNode::make(in_mem); + MergeMemNode* mem = phase->transform(MergeMemNode::make(in_mem))->as_MergeMem(); const TypeInstPtr* inst_src = src_type->isa_instptr(); @@ -367,7 +367,7 @@ void ArrayCopyNode::array_copy_test_overlap(PhaseGVN *phase, bool can_reshape, b Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase, bool can_reshape, Node*& forward_ctl, - MergeMemNode* mm, + Node* mem, const TypePtr* atp_src, const TypePtr* atp_dest, Node* adr_src, @@ -379,7 +379,7 @@ Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase, int count) { if (!forward_ctl->is_top()) { // copy forward - mm = mm->clone()->as_MergeMem(); + MergeMemNode* mm = MergeMemNode::make(mem); if (count > 0) { BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); @@ -392,7 +392,7 @@ Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase, v = load(bs, phase, forward_ctl, mm, next_src, atp_src, value_type, copy_type); store(bs, phase, forward_ctl, mm, next_dest, atp_dest, v, value_type, copy_type); } - } else if(can_reshape) { + } else if (can_reshape) { PhaseIterGVN* igvn = phase->is_IterGVN(); igvn->_worklist.push(adr_src); igvn->_worklist.push(adr_dest); @@ -405,7 +405,7 @@ Node* ArrayCopyNode::array_copy_forward(PhaseGVN *phase, Node* ArrayCopyNode::array_copy_backward(PhaseGVN *phase, bool can_reshape, Node*& backward_ctl, - MergeMemNode* mm, + Node* mem, const TypePtr* atp_src, const TypePtr* atp_dest, Node* adr_src, @@ -417,7 +417,7 @@ Node* ArrayCopyNode::array_copy_backward(PhaseGVN *phase, int count) { if (!backward_ctl->is_top()) { // copy backward - mm = mm->clone()->as_MergeMem(); + MergeMemNode* mm = MergeMemNode::make(mem); BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); assert(copy_type != T_OBJECT || !bs->array_copy_requires_gc_barriers(false, T_OBJECT, false, BarrierSetC2::Optimization), "only tightly coupled allocations for object arrays"); @@ -432,7 +432,7 @@ Node* ArrayCopyNode::array_copy_backward(PhaseGVN *phase, } Node* v = load(bs, phase, backward_ctl, mm, adr_src, atp_src, value_type, copy_type); store(bs, phase, backward_ctl, mm, adr_dest, atp_dest, v, value_type, copy_type); - } else if(can_reshape) { + } else if (can_reshape) { PhaseIterGVN* igvn = phase->is_IterGVN(); igvn->_worklist.push(adr_src); igvn->_worklist.push(adr_dest); @@ -564,11 +564,7 @@ Node *ArrayCopyNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* dest = in(ArrayCopyNode::Dest); const TypePtr* atp_src = get_address_type(phase, _src_type, src); const TypePtr* atp_dest = get_address_type(phase, _dest_type, dest); - - Node *in_mem = in(TypeFunc::Memory); - if (!in_mem->is_MergeMem()) { - in_mem = MergeMemNode::make(in_mem); - } + Node* in_mem = in(TypeFunc::Memory); if (can_reshape) { assert(!phase->is_IterGVN()->delay_transform(), "cannot delay transforms"); @@ -580,13 +576,13 @@ Node *ArrayCopyNode::Ideal(PhaseGVN *phase, bool can_reshape) { array_copy_test_overlap(phase, can_reshape, disjoint_bases, count, forward_ctl, backward_ctl); Node* forward_mem = array_copy_forward(phase, can_reshape, forward_ctl, - in_mem->as_MergeMem(), + in_mem, atp_src, atp_dest, adr_src, base_src, adr_dest, base_dest, copy_type, value_type, count); Node* backward_mem = array_copy_backward(phase, can_reshape, backward_ctl, - in_mem->as_MergeMem(), + in_mem, atp_src, atp_dest, adr_src, base_src, adr_dest, base_dest, copy_type, value_type, count); diff --git a/src/hotspot/share/opto/arraycopynode.hpp b/src/hotspot/share/opto/arraycopynode.hpp index 4764715a60a18..da17efc160793 100644 --- a/src/hotspot/share/opto/arraycopynode.hpp +++ b/src/hotspot/share/opto/arraycopynode.hpp @@ -100,12 +100,12 @@ class ArrayCopyNode : public CallNode { bool disjoint_bases, int count, Node*& forward_ctl, Node*& backward_ctl); Node* array_copy_forward(PhaseGVN *phase, bool can_reshape, Node*& ctl, - MergeMemNode* mm, + Node* mem, const TypePtr* atp_src, const TypePtr* atp_dest, Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest, BasicType copy_type, const Type* value_type, int count); Node* array_copy_backward(PhaseGVN *phase, bool can_reshape, Node*& ctl, - MergeMemNode* mm, + Node* mem, const TypePtr* atp_src, const TypePtr* atp_dest, Node* adr_src, Node* base_src, Node* adr_dest, Node* base_dest, BasicType copy_type, const Type* value_type, int count); diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp index ad527082e6336..486d0b2bec852 100644 --- a/src/hotspot/share/opto/cfgnode.cpp +++ b/src/hotspot/share/opto/cfgnode.cpp @@ -2302,12 +2302,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* phi = mms.memory(); mms.set_memory(phase->transform(phi)); } - if (igvn) { // Unhook. - igvn->hash_delete(hook); - for (uint i = 1; i < hook->req(); i++) { - hook->set_req(i, NULL); - } - } + hook->destruct(igvn); // Replace self with the result. return result; } diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp index 39a375f027a0e..a170fb197ab7a 100644 --- a/src/hotspot/share/opto/compile.cpp +++ b/src/hotspot/share/opto/compile.cpp @@ -1128,8 +1128,7 @@ void Compile::print_missing_nodes() { } } void Compile::record_modified_node(Node* n) { - if (_modified_nodes != NULL && !_inlining_incrementally && - n->outcnt() != 0 && !n->is_Con()) { + if (_modified_nodes != NULL && !_inlining_incrementally && !n->is_Con()) { _modified_nodes->push(n); } } diff --git a/src/hotspot/share/opto/convertnode.cpp b/src/hotspot/share/opto/convertnode.cpp index fa556b16dd58d..304b0380753d3 100644 --- a/src/hotspot/share/opto/convertnode.cpp +++ b/src/hotspot/share/opto/convertnode.cpp @@ -403,8 +403,7 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node *hook = new Node(1); hook->init_req(0, cx); // Add a use to cx to prevent him from dying Node* cy = phase->C->constrained_convI2L(phase, y, TypeInt::make(rylo, ryhi, widen), NULL); - hook->del_req(0); // Just yank bogus edge - hook->destruct(); + hook->destruct(phase); switch (op) { case Op_AddI: return new AddLNode(cx, cy); case Op_SubI: return new SubLNode(cx, cy); diff --git a/src/hotspot/share/opto/divnode.cpp b/src/hotspot/share/opto/divnode.cpp index a79f57f8cb407..2e5d65682707d 100644 --- a/src/hotspot/share/opto/divnode.cpp +++ b/src/hotspot/share/opto/divnode.cpp @@ -326,14 +326,7 @@ static Node* long_by_long_mulhi(PhaseGVN* phase, Node* dividend, jlong magic_con Node* temp2 = phase->transform(new RShiftLNode(w1, phase->intcon(N / 2))); // Remove the bogus extra edges used to keep things alive - PhaseIterGVN* igvn = phase->is_IterGVN(); - if (igvn != NULL) { - igvn->remove_dead_node(hook); - } else { - for (int i = 0; i < 4; i++) { - hook->set_req(i, NULL); - } - } + hook->destruct(phase); return new AddLNode(temp1, temp2); } @@ -916,11 +909,7 @@ Node *ModINode::Ideal(PhaseGVN *phase, bool can_reshape) { // cmov2 is now the mod // Now remove the bogus extra edges used to keep things alive - if (can_reshape) { - phase->is_IterGVN()->remove_dead_node(hook); - } else { - hook->set_req(0, NULL); // Just yank bogus edge during Parse phase - } + hook->destruct(phase); return cmov2; } } @@ -972,11 +961,7 @@ Node *ModINode::Ideal(PhaseGVN *phase, bool can_reshape) { } // Now remove the bogus extra edges used to keep things alive - if (can_reshape) { - phase->is_IterGVN()->remove_dead_node(hook); - } else { - hook->set_req(0, NULL); // Just yank bogus edge during Parse phase - } + hook->destruct(phase); // return the value return result; @@ -1091,11 +1076,7 @@ Node *ModLNode::Ideal(PhaseGVN *phase, bool can_reshape) { // cmov2 is now the mod // Now remove the bogus extra edges used to keep things alive - if (can_reshape) { - phase->is_IterGVN()->remove_dead_node(hook); - } else { - hook->set_req(0, NULL); // Just yank bogus edge during Parse phase - } + hook->destruct(phase); return cmov2; } } @@ -1147,11 +1128,7 @@ Node *ModLNode::Ideal(PhaseGVN *phase, bool can_reshape) { } // Now remove the bogus extra edges used to keep things alive - if (can_reshape) { - phase->is_IterGVN()->remove_dead_node(hook); - } else { - hook->set_req(0, NULL); // Just yank bogus edge during Parse phase - } + hook->destruct(phase); // return the value return result; diff --git a/src/hotspot/share/opto/ifnode.cpp b/src/hotspot/share/opto/ifnode.cpp index ddf543ab82289..f2a24ed185720 100644 --- a/src/hotspot/share/opto/ifnode.cpp +++ b/src/hotspot/share/opto/ifnode.cpp @@ -999,8 +999,7 @@ bool IfNode::fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* f if (adjusted_lim == NULL) { adjusted_lim = igvn->transform(new SubINode(hi, lo)); } - hook->del_req(0); // Just yank bogus edge - hook->destruct(); + hook->destruct(igvn); Node* newcmp = igvn->transform(new CmpUNode(adjusted_val, adjusted_lim)); Node* newbool = igvn->transform(new BoolNode(newcmp, cond)); diff --git a/src/hotspot/share/opto/lcm.cpp b/src/hotspot/share/opto/lcm.cpp index 0ef3a43922782..90452e97e23da 100644 --- a/src/hotspot/share/opto/lcm.cpp +++ b/src/hotspot/share/opto/lcm.cpp @@ -430,7 +430,7 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo tmp1->replace_by(tmp); tmp2->replace_by(tmp1); tmp->replace_by(tmp2); - tmp->destruct(); + tmp->destruct(NULL); } // Remove the existing null check; use a new implicit null check instead. diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp index 7f04d2ac6c276..fbe0c94a474ad 100644 --- a/src/hotspot/share/opto/loopPredicate.cpp +++ b/src/hotspot/share/opto/loopPredicate.cpp @@ -727,7 +727,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(IdealLoopTree *loop, Node* ctrl, idx_type = (TypeInt*)mul->mul_ring(idx_type, scale_type); if (overflow || TypeInt::INT->higher_equal(idx_type)) { // May overflow - mul->destruct(); + mul->destruct(&_igvn); if (!overflow) { max_idx_expr = new ConvI2LNode(max_idx_expr); register_new_node(max_idx_expr, ctrl); diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index 7eed86d461eac..98934145eeb7b 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -1400,8 +1400,6 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { assert(x->Opcode() == Op_Loop, "regular loops only"); C->print_method(PHASE_BEFORE_CLOOPS, 3); - Node *hook = new Node(6); - // =================================================== // Generate loop limit check to avoid integer overflow // in cases like next (cyclic loops): @@ -1691,9 +1689,6 @@ bool PhaseIdealLoop::is_counted_loop(Node* x, IdealLoopTree*& loop) { } } - // Free up intermediate goo - _igvn.remove_dead_node(hook); - #ifdef ASSERT assert(l->is_valid_counted_loop(), "counted loop shape is messed up"); assert(l == loop->_head && l->phi() == phi && l->loopexit_or_null() == lex, "" ); @@ -2656,7 +2651,7 @@ void IdealLoopTree::split_fall_in( PhaseIdealLoop *phase, int fall_in_cnt ) { // with the CSE to avoid O(N^2) node blow-up. Node *p2 = igvn.hash_find_insert(p); // Look for a CSE if( p2 ) { // Found CSE - p->destruct(); // Recover useless new node + p->destruct(&igvn); // Recover useless new node p = p2; // Use old node } else { igvn.register_new_node_with_optimizer(p, old_phi); diff --git a/src/hotspot/share/opto/macro.cpp b/src/hotspot/share/opto/macro.cpp index 0f8cbcedfdafb..b51fafcb440ef 100644 --- a/src/hotspot/share/opto/macro.cpp +++ b/src/hotspot/share/opto/macro.cpp @@ -329,7 +329,7 @@ Node* PhaseMacroExpand::make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset, Node* base = ac->in(ArrayCopyNode::Src); Node* adr = _igvn.transform(new AddPNode(base, base, MakeConX(offset))); const TypePtr* adr_type = _igvn.type(base)->is_ptr()->add_offset(offset); - MergeMemNode* mergemen = MergeMemNode::make(mem); + MergeMemNode* mergemen = _igvn.transform(MergeMemNode::make(mem))->as_MergeMem(); BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); res = ArrayCopyNode::load(bs, &_igvn, ctl, mergemen, adr, adr_type, type, bt); } else { @@ -369,7 +369,7 @@ Node* PhaseMacroExpand::make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset, return NULL; } } - MergeMemNode* mergemen = MergeMemNode::make(mem); + MergeMemNode* mergemen = _igvn.transform(MergeMemNode::make(mem))->as_MergeMem(); BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2(); res = ArrayCopyNode::load(bs, &_igvn, ctl, mergemen, adr, adr_type, type, bt); } diff --git a/src/hotspot/share/opto/node.cpp b/src/hotspot/share/opto/node.cpp index 78a4c2f15848e..7b854a2192bb3 100644 --- a/src/hotspot/share/opto/node.cpp +++ b/src/hotspot/share/opto/node.cpp @@ -581,8 +581,11 @@ void Node::setup_is_top() { //------------------------------~Node------------------------------------------ // Fancy destructor; eagerly attempt to reclaim Node numberings and storage -void Node::destruct() { - Compile* compile = Compile::current(); +void Node::destruct(PhaseValues* phase) { + Compile* compile = (phase != NULL) ? phase->C : Compile::current(); + if (phase != NULL && phase->is_IterGVN()) { + phase->is_IterGVN()->_worklist.remove(this); + } // If this is the most recently created node, reclaim its index. Otherwise, // record the node as dead to keep liveness information accurate. if ((uint)_idx+1 == compile->unique()) { @@ -1399,7 +1402,6 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) { // Done with outputs. igvn->hash_delete(dead); igvn->_worklist.remove(dead); - igvn->C->remove_modified_node(dead); igvn->set_type(dead, Type::TOP); if (dead->is_macro()) { igvn->C->remove_macro_node(dead); @@ -1435,6 +1437,7 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) { } } } + igvn->C->remove_modified_node(dead); } // (dead->outcnt() == 0) } // while (nstack.size() > 0) for outputs return; diff --git a/src/hotspot/share/opto/node.hpp b/src/hotspot/share/opto/node.hpp index 7dc59465a5e9b..d156dd2c4544d 100644 --- a/src/hotspot/share/opto/node.hpp +++ b/src/hotspot/share/opto/node.hpp @@ -236,7 +236,7 @@ class Node { // Delete is a NOP void operator delete( void *ptr ) {} // Fancy destructor; eagerly attempt to reclaim Node numberings and storage - void destruct(); + void destruct(PhaseValues* phase); // Create a new Node. Required is the number is of inputs required for // semantic correctness. diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index 763132d6af8ab..1d144b1fbcd82 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -749,7 +749,7 @@ ConNode* PhaseValues::uncached_makecon(const Type *t) { loc->clear(); // do not put debug info on constants } } else { - x->destruct(); // Hit, destroy duplicate constant + x->destruct(this); // Hit, destroy duplicate constant x = k; // use existing constant } return x; @@ -1069,9 +1069,9 @@ void PhaseIterGVN::init_verifyPhaseIterGVN() { Unique_Node_List* modified_list = C->modified_nodes(); while (modified_list != NULL && modified_list->size()) { Node* n = modified_list->pop(); - if (n->outcnt() != 0 && !n->is_Con() && !_worklist.member(n)) { + if (!n->is_Con() && !_worklist.member(n)) { n->dump(); - assert(false, "modified node is not on IGVN._worklist"); + fatal("modified node is not on IGVN._worklist"); } } #endif @@ -1083,9 +1083,9 @@ void PhaseIterGVN::verify_PhaseIterGVN() { Unique_Node_List* modified_list = C->modified_nodes(); while (modified_list != NULL && modified_list->size()) { Node* n = modified_list->pop(); - if (n->outcnt() != 0 && !n->is_Con()) { // skip dead and Con nodes + if (!n->is_Con()) { // skip Con nodes n->dump(); - assert(false, "modified node was not processed by IGVN.transform_old()"); + fatal("modified node was not processed by IGVN.transform_old()"); } } #endif @@ -1472,8 +1472,7 @@ void PhaseIterGVN::subsume_node( Node *old, Node *nn ) { } } #endif - _worklist.remove(temp); // this can be necessary - temp->destruct(); // reuse the _idx of this little guy + temp->destruct(this); // reuse the _idx of this little guy } //------------------------------add_users_to_worklist-------------------------- diff --git a/src/hotspot/share/opto/split_if.cpp b/src/hotspot/share/opto/split_if.cpp index f761bdc0c1e29..6bf835926e525 100644 --- a/src/hotspot/share/opto/split_if.cpp +++ b/src/hotspot/share/opto/split_if.cpp @@ -337,7 +337,7 @@ Node *PhaseIdealLoop::spinup( Node *iff_dom, Node *new_false, Node *new_true, No if( t ) { // See if we already have this one // phi_post will not be used, so kill it _igvn.remove_dead_node(phi_post); - phi_post->destruct(); + phi_post->destruct(&_igvn); phi_post = t; } else { register_new_node( phi_post, prior_n ); diff --git a/src/hotspot/share/prims/jvm.cpp b/src/hotspot/share/prims/jvm.cpp index 2ac00310f3741..4705b6a935cc9 100644 --- a/src/hotspot/share/prims/jvm.cpp +++ b/src/hotspot/share/prims/jvm.cpp @@ -3439,6 +3439,24 @@ JVM_ENTRY(void, JVM_WaitForReferencePendingList(JNIEnv* env)) } JVM_END +JVM_ENTRY(jboolean, JVM_ReferenceRefersTo(JNIEnv* env, jobject ref, jobject o)) + JVMWrapper("JVM_ReferenceRefersTo"); + oop ref_oop = JNIHandles::resolve_non_null(ref); + oop referent = java_lang_ref_Reference::weak_referent_no_keepalive(ref_oop); + return referent == JNIHandles::resolve(o); +JVM_END + + +// java.lang.ref.PhantomReference ////////////////////////////////////////////////// + + +JVM_ENTRY(jboolean, JVM_PhantomReferenceRefersTo(JNIEnv* env, jobject ref, jobject o)) + JVMWrapper("JVM_PhantomReferenceRefersTo"); + oop ref_oop = JNIHandles::resolve_non_null(ref); + oop referent = java_lang_ref_Reference::phantom_referent_no_keepalive(ref_oop); + return referent == JNIHandles::resolve(o); +JVM_END + // ObjectInputStream /////////////////////////////////////////////////////////////// diff --git a/src/hotspot/share/prims/jvmtiExport.cpp b/src/hotspot/share/prims/jvmtiExport.cpp index 4d7db18f2b7dc..3fdf6d9ee8a23 100644 --- a/src/hotspot/share/prims/jvmtiExport.cpp +++ b/src/hotspot/share/prims/jvmtiExport.cpp @@ -1567,16 +1567,12 @@ void JvmtiExport::post_method_entry(JavaThread *thread, Method* method, frame cu } } -void JvmtiExport::post_method_exit(JavaThread *thread, Method* method, frame current_frame) { +void JvmtiExport::post_method_exit(JavaThread* thread, Method* method, frame current_frame) { HandleMark hm(thread); methodHandle mh(thread, method); - EVT_TRIG_TRACE(JVMTI_EVENT_METHOD_EXIT, ("[%s] Trg Method Exit triggered %s.%s", - JvmtiTrace::safe_get_thread_name(thread), - (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(), - (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() )); - JvmtiThreadState *state = thread->jvmti_thread_state(); + if (state == NULL || !state->is_interp_only_mode()) { // for any thread that actually wants method exit, interp_only_mode is set return; @@ -1585,13 +1581,11 @@ void JvmtiExport::post_method_exit(JavaThread *thread, Method* method, frame cur // return a flag when a method terminates by throwing an exception // i.e. if an exception is thrown and it's not caught by the current method bool exception_exit = state->is_exception_detected() && !state->is_exception_caught(); - + Handle result; + jvalue value; + value.j = 0L; if (state->is_enabled(JVMTI_EVENT_METHOD_EXIT)) { - Handle result; - jvalue value; - value.j = 0L; - // if the method hasn't been popped because of an exception then we populate // the return_value parameter for the callback. At this point we only have // the address of a "raw result" and we just call into the interpreter to @@ -1601,9 +1595,36 @@ void JvmtiExport::post_method_exit(JavaThread *thread, Method* method, frame cur BasicType type = current_frame.interpreter_frame_result(&oop_result, &value); if (is_reference_type(type)) { result = Handle(thread, oop_result); + value.l = JNIHandles::make_local(thread, result()); } } + } + // Deferred transition to VM, so we can stash away the return oop before GC + // Note that this transition is not needed when throwing an exception, because + // there is no oop to retain. + JRT_BLOCK + post_method_exit_inner(thread, mh, state, exception_exit, current_frame, value); + JRT_BLOCK_END + + if (result.not_null() && !mh->is_native()) { + // We have to restore the oop on the stack for interpreter frames + *(oop*)current_frame.interpreter_frame_tos_address() = result(); + } +} + +void JvmtiExport::post_method_exit_inner(JavaThread* thread, + methodHandle& mh, + JvmtiThreadState *state, + bool exception_exit, + frame current_frame, + jvalue& value) { + EVT_TRIG_TRACE(JVMTI_EVENT_METHOD_EXIT, ("[%s] Trg Method Exit triggered %s.%s", + JvmtiTrace::safe_get_thread_name(thread), + (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(), + (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() )); + + if (state->is_enabled(JVMTI_EVENT_METHOD_EXIT)) { JvmtiEnvThreadStateIterator it(state); for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) { if (ets->is_enabled(JVMTI_EVENT_METHOD_EXIT)) { @@ -1614,9 +1635,6 @@ void JvmtiExport::post_method_exit(JavaThread *thread, Method* method, frame cur JvmtiEnv *env = ets->get_env(); JvmtiMethodEventMark jem(thread, mh); - if (result.not_null()) { - value.l = JNIHandles::make_local(thread, result()); - } JvmtiJavaThreadEventTransition jet(thread); jvmtiEventMethodExit callback = env->callbacks()->MethodExit; if (callback != NULL) { @@ -1808,7 +1826,9 @@ void JvmtiExport::notice_unwind_due_to_exception(JavaThread *thread, Method* met if(state->is_interp_only_mode()) { // method exit and frame pop events are posted only in interp mode. // When these events are enabled code should be in running in interp mode. - JvmtiExport::post_method_exit(thread, method, thread->last_frame()); + jvalue no_value; + no_value.j = 0L; + JvmtiExport::post_method_exit_inner(thread, mh, state, true, thread->last_frame(), no_value); // The cached cur_stack_depth might have changed from the // operations of frame pop or method exit. We are not 100% sure // the cached cur_stack_depth is still valid depth so invalidate diff --git a/src/hotspot/share/prims/jvmtiExport.hpp b/src/hotspot/share/prims/jvmtiExport.hpp index c3e606d90409b..72a89502ad027 100644 --- a/src/hotspot/share/prims/jvmtiExport.hpp +++ b/src/hotspot/share/prims/jvmtiExport.hpp @@ -194,6 +194,13 @@ class JvmtiExport : public AllStatic { // dependency information is complete or not. static bool _all_dependencies_are_recorded; + static void post_method_exit_inner(JavaThread* thread, + methodHandle& mh, + JvmtiThreadState *state, + bool exception_exit, + frame current_frame, + jvalue& value); + public: inline static bool has_redefined_a_class() { JVMTI_ONLY(return _redefinition_count != 0); diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index 6ae94f95a5cf3..e5636525eff3a 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -532,9 +532,6 @@ const intx ObjectAlignmentInBytes = 8; "error log in case of a crash.") \ range(0, (uint64_t)max_jlong/1000) \ \ - product_pd(bool, UseOSErrorReporting, \ - "Let VM fatal error propagate to the OS (ie. WER on Windows)") \ - \ product(bool, SuppressFatalErrorMessage, false, \ "Report NO fatal error message (avoid deadlock)") \ \ diff --git a/src/hotspot/share/runtime/java.cpp b/src/hotspot/share/runtime/java.cpp index ca559aca4dff3..c7726fd538809 100644 --- a/src/hotspot/share/runtime/java.cpp +++ b/src/hotspot/share/runtime/java.cpp @@ -578,6 +578,13 @@ void vm_direct_exit(int code) { os::exit(code); } +void vm_direct_exit(int code, const char* message) { + if (message != nullptr) { + tty->print_cr("%s", message); + } + vm_direct_exit(code); +} + void vm_perform_shutdown_actions() { if (is_init_completed()) { Thread* thread = Thread::current_or_null(); diff --git a/src/hotspot/share/runtime/java.hpp b/src/hotspot/share/runtime/java.hpp index c24b2619c6eff..8fb5aff75fd8a 100644 --- a/src/hotspot/share/runtime/java.hpp +++ b/src/hotspot/share/runtime/java.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 @@ -35,6 +35,7 @@ extern void vm_exit(int code); // Wrapper for ::exit() extern void vm_direct_exit(int code); +extern void vm_direct_exit(int code, const char* message); // Shutdown the VM but do not exit the process extern void vm_shutdown(); diff --git a/src/hotspot/share/runtime/os.cpp b/src/hotspot/share/runtime/os.cpp index 433818c8d246b..bca50071ef976 100644 --- a/src/hotspot/share/runtime/os.cpp +++ b/src/hotspot/share/runtime/os.cpp @@ -1002,8 +1002,14 @@ void os::print_date_and_time(outputStream *st, char* buf, size_t buflen) { struct tm tz; if (localtime_pd(&tloc, &tz) != NULL) { - ::strftime(buf, buflen, "%Z", &tz); - st->print("Time: %s %s", timestring, buf); + wchar_t w_buf[80]; + size_t n = ::wcsftime(w_buf, 80, L"%Z", &tz); + if (n > 0) { + ::wcstombs(buf, w_buf, buflen); + st->print("Time: %s %s", timestring, buf); + } else { + st->print("Time: %s", timestring); + } } else { st->print("Time: %s", timestring); } diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 6de01d127c9f2..24a076e0d8421 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -1964,8 +1964,8 @@ typedef HashtableEntry KlassHashtableEntry; declare_integer_type(AccessFlags) /* FIXME: wrong type (not integer) */\ declare_toplevel_type(address) /* FIXME: should this be an integer type? */\ declare_integer_type(BasicType) /* FIXME: wrong type (not integer) */ \ - declare_toplevel_type(BreakpointInfo) \ - declare_toplevel_type(BreakpointInfo*) \ + JVMTI_ONLY(declare_toplevel_type(BreakpointInfo)) \ + JVMTI_ONLY(declare_toplevel_type(BreakpointInfo*)) \ declare_toplevel_type(CodeBlob*) \ declare_toplevel_type(RuntimeBlob*) \ declare_toplevel_type(CompressedWriteStream*) \ diff --git a/src/hotspot/share/services/diagnosticCommand.cpp b/src/hotspot/share/services/diagnosticCommand.cpp index b0be7c312b994..451c94d045841 100644 --- a/src/hotspot/share/services/diagnosticCommand.cpp +++ b/src/hotspot/share/services/diagnosticCommand.cpp @@ -304,6 +304,7 @@ void JVMTIDataDumpDCmd::execute(DCmdSource source, TRAPS) { } #if INCLUDE_SERVICES +#if INCLUDE_JVMTI JVMTIAgentLoadDCmd::JVMTIAgentLoadDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), _libpath("library path", "Absolute path of the JVMTI agent to load.", @@ -363,6 +364,7 @@ int JVMTIAgentLoadDCmd::num_arguments() { return 0; } } +#endif // INCLUDE_JVMTI #endif // INCLUDE_SERVICES void PrintSystemPropertiesDCmd::execute(DCmdSource source, TRAPS) { diff --git a/src/hotspot/share/utilities/vmError.cpp b/src/hotspot/share/utilities/vmError.cpp index 9567eabb54daf..16e3b8e11c212 100644 --- a/src/hotspot/share/utilities/vmError.cpp +++ b/src/hotspot/share/utilities/vmError.cpp @@ -1420,10 +1420,12 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt // are handled properly. reset_signal_handlers(); } else { - // If UseOsErrorReporting we call this for each level of the call stack +#if defined(_WINDOWS) + // If UseOSErrorReporting we call this for each level of the call stack // while searching for the exception handler. Only the first level needs // to be reported. if (UseOSErrorReporting && log_done) return; +#endif // This is not the first error, see if it happened in a different thread // or in the same thread during error reporting. @@ -1613,7 +1615,7 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt OnError = NULL; } - if (!UseOSErrorReporting) { + if (WINDOWS_ONLY(!UseOSErrorReporting) NOT_WINDOWS(true)) { // os::abort() will call abort hooks, try it first. static bool skip_os_abort = false; if (!skip_os_abort) { diff --git a/src/java.base/share/classes/java/io/InputStream.java b/src/java.base/share/classes/java/io/InputStream.java index e260e0e14452e..df398373b5002 100644 --- a/src/java.base/share/classes/java/io/InputStream.java +++ b/src/java.base/share/classes/java/io/InputStream.java @@ -1,5 +1,5 @@ /* - * 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 @@ -416,6 +416,9 @@ public byte[] readNBytes(int len) throws IOException { if (MAX_BUFFER_SIZE - total < nread) { throw new OutOfMemoryError("Required array size too large"); } + if (nread < buf.length) { + buf = Arrays.copyOfRange(buf, 0, nread); + } total += nread; if (result == null) { result = buf; diff --git a/src/java.base/share/classes/java/lang/ref/PhantomReference.java b/src/java.base/share/classes/java/lang/ref/PhantomReference.java index b79e3385a7f3c..d653dc7ffba31 100644 --- a/src/java.base/share/classes/java/lang/ref/PhantomReference.java +++ b/src/java.base/share/classes/java/lang/ref/PhantomReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, 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 @@ -60,6 +60,14 @@ public T get() { return null; } + /* Override the implementation of Reference.refersTo. + * Phantom references are weaker than finalization, so the referent + * access needs to be handled differently for garbage collectors that + * do reference processing concurrently. + */ + @Override + native final boolean refersTo0(Object o); + /** * Creates a new phantom reference that refers to the given object and * is registered with the given queue. diff --git a/src/java.base/share/classes/java/lang/ref/Reference.java b/src/java.base/share/classes/java/lang/ref/Reference.java index 132680c175361..e655a85792b25 100644 --- a/src/java.base/share/classes/java/lang/ref/Reference.java +++ b/src/java.base/share/classes/java/lang/ref/Reference.java @@ -325,14 +325,40 @@ public void runFinalization() { * been cleared, either by the program or by the garbage collector, then * this method returns {@code null}. * + * @apiNote + * This method returns a strong reference to the referent. This may cause + * the garbage collector to treat it as strongly reachable until some later + * collection cycle. The {@link #refersTo(Object) refersTo} method can be + * used to avoid such strengthening when testing whether some object is + * the referent of a reference object; that is, use {@code ref.refersTo(obj)} + * rather than {@code ref.get() == obj}. + * * @return The object to which this reference refers, or * {@code null} if this reference object has been cleared + * @see refersTo */ @IntrinsicCandidate public T get() { return this.referent; } + /** + * Tests if the referent of this reference object is {@code obj}. + * Using a {@code null} {@code obj} returns {@code true} if the + * reference object has been cleared. + * + * @param obj the object to compare with this reference object's referent + * @return {@code true} if {@code obj} is the referent of this reference object + * @since 16 + */ + public final boolean refersTo(T obj) { + return refersTo0(obj); + } + + /* Implementation of refersTo(), overridden for phantom references. + */ + native boolean refersTo0(Object o); + /** * Clears this reference object. Invoking this method will not cause this * object to be enqueued. diff --git a/src/java.base/share/classes/jdk/internal/PreviewFeature.java b/src/java.base/share/classes/jdk/internal/PreviewFeature.java index 5624ead42d9d2..4bf0838ec2af4 100644 --- a/src/java.base/share/classes/jdk/internal/PreviewFeature.java +++ b/src/java.base/share/classes/jdk/internal/PreviewFeature.java @@ -54,7 +54,6 @@ public boolean essentialAPI() default false; public enum Feature { - PATTERN_MATCHING_IN_INSTANCEOF, // 8242284: // The TEXT_BLOCKS enum constant is not used in the JDK 15 codebase, but // exists to support the bootcycle build of JDK 15. The bootcycle build diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java index 12ea481767e29..9d0ae93b47092 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java @@ -209,7 +209,7 @@ jdk.jartool, jdk.jfr, jdk.jlink, - jdk.incubator.jpackage; + jdk.jpackage; exports jdk.internal.perf to java.management, jdk.management.agent, diff --git a/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java b/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java index 720be39e2bbc6..505024bebad1c 100644 --- a/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java +++ b/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.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 @@ -573,8 +573,12 @@ private static ZoneInfo getZoneInfo(String zoneId, // we can then pass in the dom = -1, dow > 0 into ZoneInfo // // hacking, assume the >=24 is the result of ZRB optimization for - // "last", it works for now. - if (dom < 0 || dom >= 24) { + // "last", it works for now. From tzdata2020d this hacking + // will not work for Asia/Gaza and Asia/Hebron which follow + // Palestine DST rules. + if (dom < 0 || dom >= 24 && + !(zoneId.equals("Asia/Gaza") || + zoneId.equals("Asia/Hebron"))) { params[1] = -1; params[2] = toCalendarDOW[dow]; } else { @@ -596,7 +600,9 @@ private static ZoneInfo getZoneInfo(String zoneId, params[7] = 0; } else { // hacking: see comment above - if (dom < 0 || dom >= 24) { + if (dom < 0 || dom >= 24 && + !(zoneId.equals("Asia/Gaza") || + zoneId.equals("Asia/Hebron"))) { params[6] = -1; params[7] = toCalendarDOW[dow]; } else { diff --git a/src/java.base/share/man/java.1 b/src/java.base/share/man/java.1 index 3a00364561684..fd78f50e1567d 100644 --- a/src/java.base/share/man/java.1 +++ b/src/java.base/share/man/java.1 @@ -1,4 +1,3 @@ -.\"t .\" Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -8,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -20,9 +19,10 @@ .\" or visit www.oracle.com if you need additional information or have any .\" questions. .\" +.\"t .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JAVA" "1" "2020" "JDK 15" "JDK Commands" +.TH "JAVA" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP @@ -181,7 +181,7 @@ with new values added and old values removed. You\[aq]ll get an error message if you use a value of \f[I]N\f[R] that is no longer supported. The supported values of \f[I]N\f[R] are the current Java SE release -(\f[CB]15\f[R]) and a limited number of previous releases, detailed in the +(\f[CB]16\f[R]) and a limited number of previous releases, detailed in the command\-line help for \f[CB]javac\f[R], under the \f[CB]\-\-source\f[R] and \f[CB]\-\-release\f[R] options. .RE @@ -4089,14 +4089,6 @@ This option was deprecated in JDK 8 and superseded by the \f[CB]\-XX:MetaspaceSize\f[R] option. .RS .RE -.TP -.B \f[CB]\-XX:+UseParallelOldGC\f[R] -Enables the use of the parallel garbage collector for full GCs. -By default, this option is disabled. -Enabling it automatically enables the \f[CB]\-XX:+UseParallelGC\f[R] -option. -.RS -.RE .SH REMOVED JAVA OPTIONS .PP These \f[CB]java\f[R] options have been removed in JDK 15 and using them @@ -4106,28 +4098,20 @@ results in an error of: \f[CB]Unrecognized\ VM\ option\f[R] \f[I]option\-name\f[R] .RE .TP -.B \f[CB]\-XX:+FailOverToOldVerifier\f[R] -Enables automatic failover to the old verifier when the new type checker -fails. -By default, this option is disabled and it\[aq]s ignored (that is, -treated as disabled) for classes with a recent bytecode version. -You can enable it only for classes with older versions of the bytecode. -.RS -.RE -.TP -.B \f[CB]\-XX:+UseConcMarkSweepGC\f[R] -Enables the use of the CMS garbage collector for the old generation. -CMS is an alternative to the default garbage collector (G1), which also -focuses on meeting application latency requirements. -By default, this option is disabled and the collector is selected -automatically based on the configuration of the machine and type of the -JVM. +.B \f[CB]\-XX:+UseParallelOldGC\f[R] +Enables the use of the parallel garbage collector for full GCs. +By default, this option is disabled. +Enabling it automatically enables the \f[CB]\-XX:+UseParallelGC\f[R] +option. .RS .RE .PP For the lists and descriptions of options removed in previous releases see the \f[I]Removed Java Options\f[R] section in: .IP \[bu] 2 +\f[B]Java Platform, Standard Edition Tools Reference, Release 15\f[R] +[https://docs.oracle.com/en/java/javase/15/docs/specs/man/java.html] +.IP \[bu] 2 \f[B]Java Platform, Standard Edition Tools Reference, Release 14\f[R] [https://docs.oracle.com/en/java/javase/14/docs/specs/man/java.html] .IP \[bu] 2 diff --git a/src/java.base/share/man/keytool.1 b/src/java.base/share/man/keytool.1 index 38008bfd7f85a..8067f45fdd290 100644 --- a/src/java.base/share/man/keytool.1 +++ b/src/java.base/share/man/keytool.1 @@ -1,4 +1,3 @@ -.\"t .\" Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -8,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -20,9 +19,10 @@ .\" or visit www.oracle.com if you need additional information or have any .\" questions. .\" +.\"t .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "KEYTOOL" "1" "2020" "JDK 15" "JDK Commands" +.TH "KEYTOOL" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP @@ -980,6 +980,28 @@ Sockets Layer (SSL) server host and port .IP \[bu] 2 {\f[CB]\-jarfile\f[R] \f[I]JAR_file\f[R]}: Signed \f[CB]\&.jar\f[R] file .IP \[bu] 2 +{\f[CB]\-keystore\f[R] \f[I]keystore\f[R]}: Keystore name +.IP \[bu] 2 +{\f[CB]\-trustcacerts\f[R]}: Trust certificates from cacerts +.IP \[bu] 2 +[\f[CB]\-storepass\f[R] \f[I]arg\f[R]]: Keystore password +.IP \[bu] 2 +{\f[CB]\-storetype\f[R] \f[I]type\f[R]}: Keystore type +.IP \[bu] 2 +{\f[CB]\-providername\f[R] \f[I]name\f[R]}: Provider name +.IP \[bu] 2 +{\f[CB]\-addprovider\f[R] \f[I]name\f[R] [\f[CB]\-providerarg\f[R] +\f[I]arg\f[R]]}: Add security provider by name (such as SunPKCS11) with +an optional configure argument. +.IP \[bu] 2 +{\f[CB]\-providerclass\f[R] \f[I]class\f[R] [\f[CB]\-providerarg\f[R] +\f[I]arg\f[R]]}: Add security provider by fully qualified class name with +an optional configure argument. +.IP \[bu] 2 +{\f[CB]\-providerpath\f[R] \f[I]list\f[R]}: Provider classpath +.IP \[bu] 2 +{\f[CB]\-protected\f[R]}: Password is provided through protected mechanism +.IP \[bu] 2 {\f[CB]\-v\f[R]}: Verbose output .PP Use the \f[CB]\-printcert\f[R] command to read and print the certificate @@ -1012,7 +1034,11 @@ command line for proxy tunneling. .PP \f[B]Note:\f[R] .PP -This option can be used independently of a keystore. +This command can be used independently of a keystore. +This command does not check for the weakness of a certificate\[aq]s +signature algorithm if it is a trusted certificate in the user keystore +(specified by \f[CB]\-keystore\f[R]) or in the \f[CB]cacerts\f[R] keystore +(if \f[CB]\-trustcacerts\f[R] is specified). .RE .TP .B \f[CB]\-printcertreq\f[R] @@ -1038,6 +1064,28 @@ command: .IP \[bu] 2 {\f[CB]\-file\ crl\f[R]}: Input file name .IP \[bu] 2 +{\f[CB]\-keystore\f[R] \f[I]keystore\f[R]}: Keystore name +.IP \[bu] 2 +{\f[CB]\-trustcacerts\f[R]}: Trust certificates from cacerts +.IP \[bu] 2 +[\f[CB]\-storepass\f[R] \f[I]arg\f[R]]: Keystore password +.IP \[bu] 2 +{\f[CB]\-storetype\f[R] \f[I]type\f[R]}: Keystore type +.IP \[bu] 2 +{\f[CB]\-providername\f[R] \f[I]name\f[R]}: Provider name +.IP \[bu] 2 +{\f[CB]\-addprovider\f[R] \f[I]name\f[R] [\f[CB]\-providerarg\f[R] +\f[I]arg\f[R]]}: Add security provider by name (such as SunPKCS11) with +an optional configure argument. +.IP \[bu] 2 +{\f[CB]\-providerclass\f[R] \f[I]class\f[R] [\f[CB]\-providerarg\f[R] +\f[I]arg\f[R]]}: Add security provider by fully qualified class name with +an optional configure argument. +.IP \[bu] 2 +{\f[CB]\-providerpath\f[R] \f[I]list\f[R]}: Provider classpath +.IP \[bu] 2 +{\f[CB]\-protected\f[R]}: Password is provided through protected mechanism +.IP \[bu] 2 {\f[CB]\-v\f[R]}: Verbose output .PP Use the \f[CB]\-printcrl\f[R] command to read the Certificate Revocation @@ -1048,7 +1096,11 @@ The CA generates the \f[CB]crl\f[R] file. .PP \f[B]Note:\f[R] .PP -This option can be used independently of a keystore. +This command can be used independently of a keystore. +This command attempts to verify the CRL using a certificate from the +user keystore (specified by \f[CB]\-keystore\f[R]) or the \f[CB]cacerts\f[R] +keystore (if \f[CB]\-trustcacerts\f[R] is specified), and will print out a +warning if it cannot be verified. .RE .SH COMMANDS FOR MANAGING THE KEYSTORE .TP @@ -1479,9 +1531,9 @@ The following examples show the defaults for various option values: \-alias\ "mykey" \-keysize -\ \ \ \ 2048\ (when\ using\ \-genkeypair\ and\ \-keyalg\ is\ "RSA") -\ \ \ \ 2048\ (when\ using\ \-genkeypair\ and\ \-keyalg\ is\ "DSA") +\ \ \ \ 2048\ (when\ using\ \-genkeypair\ and\ \-keyalg\ is\ "RSA",\ "DSA",\ or\ "RSASSA\-PSS") \ \ \ \ 256\ (when\ using\ \-genkeypair\ and\ \-keyalg\ is\ "EC") +\ \ \ \ 255\ (when\ using\ \-genkeypair\ and\ \-keyalg\ is\ "EdDSA") \ \ \ \ 56\ (when\ using\ \-genseckey\ and\ \-keyalg\ is\ "DES") \ \ \ \ 168\ (when\ using\ \-genseckey\ and\ \-keyalg\ is\ "DESede") @@ -1564,7 +1616,66 @@ T}@T{ T}@T{ SHA512withECDSA T} +T{ +RSASSA\-PSS +T}@T{ +<= 3072 +T}@T{ +RSASSA\-PSS (with SHA\-256) +T} +T{ +T}@T{ +<= 7680 +T}@T{ +RSASSA\-PSS (with SHA\-384) +T} +T{ +T}@T{ +> 7680 +T}@T{ +RSASSA\-PSS (with SHA\-512) +T} +T{ +EdDSA +T}@T{ +255 +T}@T{ +Ed25519 +T} +T{ +T}@T{ +448 +T}@T{ +Ed448 +T} +T{ +Ed25519 +T}@T{ +255 +T}@T{ +Ed25519 +T} +T{ +Ed448 +T}@T{ +448 +T}@T{ +Ed448 +T} .TE +.IP \[bu] 2 +An RSASSA\-PSS signature algorithm uses a \f[CB]MessageDigest\f[R] +algorithm as its hash and MGF1 algorithms. +.IP \[bu] 2 +EdDSA supports 2 key sizes: Ed25519 and Ed448. +When generating an EdDSA key pair using \f[CB]\-keyalg\ EdDSA\f[R], a user +can specify \f[CB]\-keysize\ 255\f[R] or \f[CB]\-keysize\ 448\f[R] to +generate Ed25519 or Ed448 key pairs. +When no \f[CB]\-keysize\f[R] is specified, an Ed25519 key pair is +generated. +A user can also directly specify \f[CB]\-keyalg\ Ed25519\f[R] or +\f[CB]\-keyalg\ Ed448\f[R] to generate a key pair with the expected key +size. .PP \f[B]Note:\f[R] .PP diff --git a/src/java.base/share/native/libjava/PhantomReference.c b/src/java.base/share/native/libjava/PhantomReference.c new file mode 100644 index 0000000000000..b6d6e7297f104 --- /dev/null +++ b/src/java.base/share/native/libjava/PhantomReference.c @@ -0,0 +1,33 @@ +/* + * 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 "jvm.h" +#include "java_lang_ref_PhantomReference.h" + +JNIEXPORT jboolean JNICALL +Java_java_lang_ref_PhantomReference_refersTo0(JNIEnv *env, jobject ref, jobject o) +{ + return JVM_PhantomReferenceRefersTo(env, ref, o); +} diff --git a/src/java.base/share/native/libjava/Reference.c b/src/java.base/share/native/libjava/Reference.c index 92c518c5d90ba..20d33e6ead640 100644 --- a/src/java.base/share/native/libjava/Reference.c +++ b/src/java.base/share/native/libjava/Reference.c @@ -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 @@ -43,3 +43,9 @@ Java_java_lang_ref_Reference_waitForReferencePendingList(JNIEnv *env, jclass ign { JVM_WaitForReferencePendingList(env); } + +JNIEXPORT jboolean JNICALL +Java_java_lang_ref_Reference_refersTo0(JNIEnv *env, jobject ref, jobject o) +{ + return JVM_ReferenceRefersTo(env, ref, o); +} diff --git a/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java b/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java index f0236ba3d53bc..72f8b05895eb2 100644 --- a/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java +++ b/src/java.base/unix/classes/sun/nio/fs/UnixFileSystem.java @@ -257,6 +257,7 @@ public Iterator iterator() { @Override public final Path getPath(String first, String... more) { + Objects.requireNonNull(first); String path; if (more.length == 0) { path = first; diff --git a/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystem.java b/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystem.java index e9a65218163a2..669ef3c087de0 100644 --- a/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystem.java +++ b/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystem.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -211,6 +211,7 @@ public Set supportedFileAttributeViews() { @Override public final Path getPath(String first, String... more) { + Objects.requireNonNull(first); String path; if (more.length == 0) { path = first; diff --git a/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java b/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java index c16a4c7f9787b..fa609761022b8 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/ElementKind.java @@ -121,20 +121,9 @@ public enum ElementKind { RECORD_COMPONENT, /** - * {@preview Associated with pattern matching for {@code - * instanceof}, a preview feature of the Java language. - * - * This enum constant is associated with pattern - * matching for {@code instanceof}, a preview - * feature of the Java language. Preview features - * may be removed in a future release, or upgraded to permanent - * features of the Java language.} - * - * A binding variable in a pattern . - * @since 14 + * A binding variable in a pattern. + * @since 16 */ - @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.PATTERN_MATCHING_IN_INSTANCEOF, - essentialAPI=false) BINDING_VARIABLE; /** diff --git a/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m index 72246e7a8873b..4cb5bc0ca57a0 100644 --- a/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m +++ b/src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m @@ -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 @@ -334,6 +334,7 @@ + (void) runAWTLoopWithApp:(NSApplication*)app { [app run]; } @catch (NSException* e) { NSLog(@"Apple AWT Startup Exception: %@", [e description]); + NSLog(@"Apple AWT Startup Exception callstack: %@", [e callStackSymbols]); NSLog(@"Apple AWT Restarting Native Event Thread"); [app stop:app]; diff --git a/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java b/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java index 1d1be4b484ff5..a100581567fba 100644 --- a/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java +++ b/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java @@ -194,7 +194,7 @@ * setInnerHTML * setOuterHTML * - * + * * *
*

Paragraph 1

diff --git a/src/java.logging/share/classes/java/util/logging/LogManager.java b/src/java.logging/share/classes/java/util/logging/LogManager.java index 7c301f8ad7cc4..a181910e94be3 100644 --- a/src/java.logging/share/classes/java/util/logging/LogManager.java +++ b/src/java.logging/share/classes/java/util/logging/LogManager.java @@ -1920,7 +1920,7 @@ public void updateConfiguration(Function * * - * {@code .level} + * {@code .level} * *
    *
  • If the resulting configuration defines a level for a logger and @@ -1941,7 +1941,7 @@ public void updateConfiguration(Function * * - * {@code .useParentHandlers} + * {@code .useParentHandlers} * *
      *
    • If either the resulting or the old value for the useParentHandlers @@ -1955,7 +1955,7 @@ public void updateConfiguration(Function * * - * {@code .handlers} + * {@code .handlers} * *
        *
      • If the resulting configuration defines a list of handlers for a @@ -1979,7 +1979,7 @@ public void updateConfiguration(Function * * - * {@code .*} + * {@code .*} * *
          *
        • Properties configured/changed on handler classes will only affect @@ -1991,7 +1991,7 @@ public void updateConfiguration(Function * * - * {@code config} and any other property + * {@code config} and any other property * *
            *
          • The resulting value for these property will be stored in the diff --git a/src/java.rmi/share/man/rmid.1 b/src/java.rmi/share/man/rmid.1 index 340a0523aa5c3..45e75ef4a7ff3 100644 --- a/src/java.rmi/share/man/rmid.1 +++ b/src/java.rmi/share/man/rmid.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "RMID" "1" "2020" "JDK 15" "JDK Commands" +.TH "RMID" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/java.rmi/share/man/rmiregistry.1 b/src/java.rmi/share/man/rmiregistry.1 index ab025ce677b58..9e33a66e5c51f 100644 --- a/src/java.rmi/share/man/rmiregistry.1 +++ b/src/java.rmi/share/man/rmiregistry.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "RMIREGISTRY" "1" "2020" "JDK 15" "JDK Commands" +.TH "RMIREGISTRY" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/java.scripting/share/man/jrunscript.1 b/src/java.scripting/share/man/jrunscript.1 index 17c6edbfd3e12..627555c93cef2 100644 --- a/src/java.scripting/share/man/jrunscript.1 +++ b/src/java.scripting/share/man/jrunscript.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JRUNSCRIPT" "1" "2020" "JDK 15" "JDK Commands" +.TH "JRUNSCRIPT" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.aot/share/man/jaotc.1 b/src/jdk.aot/share/man/jaotc.1 index eb8090dc52bdc..e5056d024322b 100644 --- a/src/jdk.aot/share/man/jaotc.1 +++ b/src/jdk.aot/share/man/jaotc.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. +.\" 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 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JAOTC" "1" "2020" "JDK 15" "JDK Commands" +.TH "JAOTC" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/BindingPatternTree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/BindingPatternTree.java index bdd4fb5673d77..247e3edc2a378 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/BindingPatternTree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/BindingPatternTree.java @@ -25,34 +25,17 @@ package com.sun.source.tree; -import javax.lang.model.element.Name; - /** - * {@preview Associated with pattern matching for instanceof, a preview feature of - * the Java language. - * - * This interface is associated with pattern matching for instanceof, a preview - * feature of the Java language. Preview features - * may be removed in a future release, or upgraded to permanent - * features of the Java language.} - * * A binding pattern tree * - * @since 14 + * @since 16 */ public interface BindingPatternTree extends PatternTree { /** - * Returns the type of the bind variable. - * @return the type + * Returns the binding variable. + * @return the binding variable */ - Tree getType(); - - /** - * A binding variable name. - * @return the name of the binding variable - */ - Name getBinding(); + VariableTree getVariable(); } - diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java index 1d501c5678bc8..ad255bcc6d055 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java @@ -49,18 +49,11 @@ public interface InstanceOfTree extends ExpressionTree { /** * Returns the type for which to check. * @return the type + * @see #getPattern() */ Tree getType(); /** - * {@preview Associated with pattern matching for instanceof, a preview feature of - * the Java language. - * - * This method is associated with pattern matching for instanceof, a preview - * feature of the Java language. Preview features - * may be removed in a future release, or upgraded to permanent - * features of the Java language.} - * * Returns the tested pattern, or null if this instanceof does not use * a pattern. * @@ -77,7 +70,7 @@ public interface InstanceOfTree extends ExpressionTree { * returns null. * * @return the tested pattern, or null if this instanceof does not use a pattern - * @since 14 + * @since 16 */ PatternTree getPattern(); } diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/PatternTree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/PatternTree.java index 70ad395cd4513..283fa20e63a49 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/PatternTree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/PatternTree.java @@ -26,17 +26,9 @@ package com.sun.source.tree; /** - * {@preview Associated with pattern matching for instanceof, a preview feature of - * the Java language. - * - * This interface is associated with pattern matching for instanceof, a preview - * feature of the Java language. Preview features - * may be removed in a future release, or upgraded to permanent - * features of the Java language.} - * * A tree node used as the base class for the different kinds of - * statements. + * patterns. * - * @since 14 + * @since 16 */ public interface PatternTree extends Tree {} diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java index 24d1305202e2d..3a6cb0910c9dd 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java @@ -220,17 +220,9 @@ public enum Kind { PARENTHESIZED(ParenthesizedTree.class), /** - * {@preview Associated with pattern matching for instanceof, a preview feature of - * the Java language. - * - * This enum constant is associated with pattern matching for instanceof, a preview - * feature of the Java language. Preview features - * may be removed in a future release, or upgraded to permanent - * features of the Java language.} - * * Used for instances of {@link BindingPatternTree}. * - * @since 14 + * @since 16 */ BINDING_PATTERN(BindingPatternTree.class), diff --git a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java index 1fb0b0a6aaeac..cbb6f720f2040 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java +++ b/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java @@ -258,19 +258,11 @@ public interface TreeVisitor { R visitLiteral(LiteralTree node, P p); /** - * {@preview Associated with pattern matching for instanceof, a preview feature of - * the Java language. - * - * This method is associated with pattern matching for instanceof, a preview - * feature of the Java language. Preview features - * may be removed in a future release, or upgraded to permanent - * features of the Java language.} - * * Visits an BindingPattern node. * @param node the node being visited * @param p a parameter value * @return a result value - * @since 14 + * @since 16 */ R visitBindingPattern(BindingPatternTree node, P p); diff --git a/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java b/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java index e7cff68e38410..b89f21dcdfe7c 100644 --- a/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java +++ b/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java @@ -691,7 +691,7 @@ public R visitInstanceOf(InstanceOfTree node, P p) { */ @Override public R visitBindingPattern(BindingPatternTree node, P p) { - return scan(node.getType(), p); + return scan(node.getVariable(), p); } /** diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java index b81adaa75836a..24a83c6a9536e 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java @@ -165,9 +165,7 @@ public boolean isEnabled() { * @return true, if given feature is a preview feature. */ public boolean isPreview(Feature feature) { - if (feature == Feature.PATTERN_MATCHING_IN_INSTANCEOF || - feature == Feature.REIFIABLE_TYPES_INSTANCEOF || - feature == Feature.SEALED_CLASSES) + if (feature == Feature.SEALED_CLASSES) return true; //Note: this is a backdoor which allows to optionally treat all features as 'preview' (for testing). //When real preview features will be added, this method can be implemented to return 'true' diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java index bcce5026a606a..a124bff84c7a6 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java @@ -1785,6 +1785,8 @@ public static class RecordComponent extends VarSymbol implements RecordComponent */ private final int pos; + private final boolean isVarargs; + /** * Construct a record component, given its flags, name, type and owner. */ @@ -1792,12 +1794,18 @@ public RecordComponent(JCVariableDecl fieldDecl, List annotations) super(PUBLIC, fieldDecl.sym.name, fieldDecl.sym.type, fieldDecl.sym.owner); this.originalAnnos = annotations; this.pos = fieldDecl.pos; + /* it is better to store the original information for this one, instead of relying + * on the info in the type of the symbol. This is because on the presence of APs + * the symbol will be blown out and we won't be able to know if the original + * record component was declared varargs or not. + */ + this.isVarargs = type.hasTag(TypeTag.ARRAY) && ((ArrayType)type).isVarargs(); } public List getOriginalAnnos() { return originalAnnos; } public boolean isVarargs() { - return type.hasTag(TypeTag.ARRAY) && ((ArrayType)type).isVarargs(); + return isVarargs; } @Override @DefinedBy(Api.LANGUAGE_MODEL) @@ -1847,7 +1855,7 @@ public Name getSimpleName() { public static class BindingSymbol extends VarSymbol { public BindingSymbol(Name name, Type type, Symbol owner) { - super(Flags.FINAL | Flags.HASINIT | Flags.MATCH_BINDING, name, type, owner); + super(Flags.HASINIT | Flags.MATCH_BINDING, name, type, owner); } public boolean isAliasFor(BindingSymbol b) { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java index 173aa65b611a1..a3976984824ed 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotations.java @@ -951,9 +951,8 @@ private Attribute.TypeCompound toTypeCompound(Attribute.Compound a, TypeAnnotati " within frame " + frame); } - case BINDING_PATTERN: case VARIABLE: - VarSymbol v = frame.hasTag(Tag.BINDINGPATTERN) ? ((JCBindingPattern) frame).symbol : ((JCVariableDecl) frame).sym; + VarSymbol v = ((JCVariableDecl) frame).sym; if (v.getKind() != ElementKind.FIELD) { appendTypeAnnotationsToOwner(v, v.getRawTypeAttributes()); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java index 1349c922a75a8..0041b402449a4 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java @@ -308,8 +308,6 @@ void checkAssignable(DiagnosticPosition pos, VarSymbol v, JCTree base, Env= firstadr || sym.owner.kind != TYP) && trackable(sym) && - !inits.isMember(sym.adr)) { + !inits.isMember(sym.adr) && + (sym.flags_field & CLASH) == 0) { log.error(pos, errkey); inits.incl(sym.adr); } @@ -2758,6 +2759,12 @@ public void visitIdent(JCIdent tree) { } } + @Override + public void visitBindingPattern(JCBindingPattern tree) { + super.visitBindingPattern(tree); + initParam(tree.var); + } + void referenced(Symbol sym) { unrefdResources.remove(sym); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MatchBindingsComputer.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MatchBindingsComputer.java index 07e48ff183805..9b3894434561f 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MatchBindingsComputer.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MatchBindingsComputer.java @@ -148,6 +148,7 @@ private List intersection(DiagnosticPosition pos, List union(DiagnosticPosition pos, List //(let T' N$temp = E; N$temp instanceof T && (N = (T) N$temp == (T) N$temp)) JCBindingPattern patt = (JCBindingPattern)tree.pattern; - VarSymbol pattSym = patt.symbol; + VarSymbol pattSym = patt.var.sym; Type tempType = tree.expr.type.hasTag(BOT) ? syms.objectType : tree.expr.type; VarSymbol temp = new VarSymbol(pattSym.flags() | Flags.SYNTHETIC, names.fromString(pattSym.name.toString() + target.syntheticNameChar() + "temp"), tempType, - patt.symbol.owner); + patt.var.sym.owner); JCExpression translatedExpr = translate(tree.expr); Type castTargetType = types.boxedTypeOrType(pattSym.erasure(types)); result = makeTypeTest(make.Ident(temp), make.Type(castTargetType)); - VarSymbol bindingVar = bindingContext.bindingDeclared(patt.symbol); + VarSymbol bindingVar = bindingContext.bindingDeclared((BindingSymbol) patt.var.sym); if (bindingVar != null) { //TODO: cannot be null here? JCAssign fakeInit = (JCAssign)make.at(tree.pos).Assign( make.Ident(bindingVar), convert(make.Ident(temp), castTargetType)).setType(bindingVar.erasure(types)); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java index fb33a7b0d7f92..ddcf6c045d20b 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java @@ -568,9 +568,7 @@ public void visitCase(JCCase tree) { } public void visitBindingPattern(JCBindingPattern tree) { - if (tree.vartype != null) { - tree.vartype = translate(tree.vartype, null); - } + tree.var = translate(tree.var, null); result = tree; } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java index 124fa61f4e8cd..971abe63a42e6 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java @@ -257,13 +257,10 @@ && scan(tree.rhs, that.rhs) @Override public void visitBindingPattern(JCBindingPattern tree) { JCBindingPattern that = (JCBindingPattern) parameter; - result = - scan(tree.vartype, that.vartype) - && tree.name == that.name; + result = scan(tree.var, that.var); if (!result) { return; } - equiv.put(tree.symbol, that.symbol); } @Override diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeHasher.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeHasher.java index 22e49a9d0dabd..a0eec4ca91da1 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeHasher.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeHasher.java @@ -106,12 +106,6 @@ public void visitSelect(JCFieldAccess tree) { super.visitSelect(tree); } - @Override - public void visitBindingPattern(JCTree.JCBindingPattern tree) { - symbolHashes.computeIfAbsent(tree.symbol, k -> symbolHashes.size()); - super.visitBindingPattern(tree); - } - @Override public void visitVarDef(JCVariableDecl tree) { symbolHashes.computeIfAbsent(tree.sym, k -> symbolHashes.size()); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java index ebcc76dc70bb9..ceeee890720af 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java @@ -932,10 +932,18 @@ JCExpression term2Rest(JCExpression t, int minprec) { if (token.kind == INSTANCEOF) { int pos = token.pos; nextToken(); - JCTree pattern = parseType(); + int typePos = token.pos; + JCExpression type = parseType(); + JCTree pattern; if (token.kind == IDENTIFIER) { checkSourceLevel(token.pos, Feature.PATTERN_MATCHING_IN_INSTANCEOF); - pattern = toP(F.at(token.pos).BindingPattern(ident(), pattern)); + JCModifiers mods = F.at(Position.NOPOS).Modifiers(0); + JCVariableDecl var = toP(F.at(token.pos).VarDef(mods, ident(), type, null)); + TreeInfo.getStartPos(var); + pattern = toP(F.at(typePos).BindingPattern(var)); + TreeInfo.getStartPos(pattern); + } else { + pattern = type; } odStack[top] = F.at(pos).TypeTest(odStack[top], pattern); } else { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties index e591a917d5719..bc8d30086793c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties @@ -545,10 +545,6 @@ compiler.err.final.parameter.may.not.be.assigned=\ compiler.err.try.resource.may.not.be.assigned=\ auto-closeable resource {0} may not be assigned -# 0: symbol -compiler.err.pattern.binding.may.not.be.assigned=\ - pattern binding {0} may not be assigned - # 0: symbol compiler.err.multicatch.parameter.may.not.be.assigned=\ multi-catch parameter {0} may not be assigned @@ -620,9 +616,6 @@ compiler.err.illegal.self.ref=\ compiler.warn.self.ref=\ self-reference in initializer of variable ''{0}'' -compiler.err.illegal.generic.type.for.instof=\ - illegal generic type for instanceof - # 0: type compiler.err.illegal.initializer.for.type=\ illegal initializer for {0} @@ -1418,6 +1411,10 @@ compiler.misc.varargs.trustme.on.reifiable.varargs=\ compiler.err.instanceof.reifiable.not.safe=\ {0} cannot be safely cast to {1} +# 0: type, 1: type +compiler.err.instanceof.pattern.no.subtype=\ + pattern type {0} is a subtype of expression type {1} + # 0: symbol compiler.misc.varargs.trustme.on.non.varargs.meth=\ Method {0} is not a varargs method. diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java index 743f46af45948..ccb3437d6116a 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java @@ -2164,7 +2164,7 @@ protected JCInstanceOf(JCExpression expr, JCTree pattern) { @DefinedBy(Api.COMPILER_TREE) public Kind getKind() { return Kind.INSTANCE_OF; } @DefinedBy(Api.COMPILER_TREE) - public JCTree getType() { return pattern instanceof JCPattern ? pattern.hasTag(BINDINGPATTERN) ? ((JCBindingPattern) pattern).vartype : null : pattern; } + public JCTree getType() { return pattern instanceof JCPattern ? pattern.hasTag(BINDINGPATTERN) ? ((JCBindingPattern) pattern).var.vartype : null : pattern; } @Override @DefinedBy(Api.COMPILER_TREE) public JCPattern getPattern() { @@ -2188,31 +2188,19 @@ public Tag getTag() { */ public static abstract class JCPattern extends JCTree implements PatternTree { - public JCExpression constExpression() { - return null; - } } public static class JCBindingPattern extends JCPattern implements BindingPatternTree { - public Name name; - public BindingSymbol symbol; - public JCTree vartype; - - protected JCBindingPattern(Name name, BindingSymbol symbol, JCTree vartype) { - this.name = name; - this.symbol = symbol; - this.vartype = vartype; - } + public JCVariableDecl var; - @DefinedBy(Api.COMPILER_TREE) - public Name getBinding() { - return name; + protected JCBindingPattern(JCVariableDecl var) { + this.var = var; } @Override @DefinedBy(Api.COMPILER_TREE) - public Tree getType() { - return vartype; + public VariableTree getVariable() { + return var; } @Override @@ -3211,7 +3199,7 @@ JCNewArray NewArray(JCExpression elemtype, JCBinary Binary(Tag opcode, JCExpression lhs, JCExpression rhs); JCTypeCast TypeCast(JCTree expr, JCExpression type); JCInstanceOf TypeTest(JCExpression expr, JCTree clazz); - JCBindingPattern BindingPattern(Name name, JCTree vartype); + JCBindingPattern BindingPattern(JCVariableDecl var); JCArrayAccess Indexed(JCExpression indexed, JCExpression index); JCFieldAccess Select(JCExpression selected, Name selector); JCIdent Ident(Name idname); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java index 48aa07d56e6c2..57109e25789c0 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/Pretty.java @@ -895,9 +895,7 @@ public void visitSwitchExpression(JCSwitchExpression tree) { public void visitBindingPattern(JCBindingPattern patt) { try { - printExpr(patt.vartype); - print(" "); - print(patt.name); + printExpr(patt.var); } catch (IOException e) { throw new UncheckedIOException(e); } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java index 5c1edf76096b3..c4f90e00e12dd 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeCopier.java @@ -493,8 +493,8 @@ public JCTree visitInstanceOf(InstanceOfTree node, P p) { @DefinedBy(Api.COMPILER_TREE) public JCTree visitBindingPattern(BindingPatternTree node, P p) { JCBindingPattern t = (JCBindingPattern) node; - JCTree vartype = copy(t.vartype, p); - return M.at(t.pos).BindingPattern(t.name, vartype); + JCVariableDecl var = copy(t.var, p); + return M.at(t.pos).BindingPattern(var); } @DefinedBy(Api.COMPILER_TREE) diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java index fc8a01d6ef842..a392d7be22f08 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java @@ -39,6 +39,7 @@ import static com.sun.tools.javac.code.Flags.*; import static com.sun.tools.javac.code.Kinds.Kind.*; +import com.sun.tools.javac.code.Symbol.VarSymbol; import static com.sun.tools.javac.code.TypeTag.BOT; import static com.sun.tools.javac.tree.JCTree.Tag.*; import static com.sun.tools.javac.tree.JCTree.Tag.BLOCK; @@ -535,7 +536,7 @@ public static int getStartPos(JCTree tree) { } case BINDINGPATTERN: { JCBindingPattern node = (JCBindingPattern)tree; - return getStartPos(node.vartype); + return getStartPos(node.var); } case ERRONEOUS: { JCErroneous node = (JCErroneous)tree; @@ -926,8 +927,6 @@ private static Symbol symbolForImpl(JCTree node) { if (node.type != null) return node.type.tsym; return null; - case BINDINGPATTERN: - return ((JCBindingPattern) node).symbol; default: return null; } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java index 8da7b73fbbc9e..f997557b72251 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeMaker.java @@ -476,8 +476,8 @@ public JCInstanceOf TypeTest(JCExpression expr, JCTree clazz) { return tree; } - public JCBindingPattern BindingPattern(Name name, JCTree vartype) { - JCBindingPattern tree = new JCBindingPattern(name, null, vartype); + public JCBindingPattern BindingPattern(JCVariableDecl var) { + JCBindingPattern tree = new JCBindingPattern(var); tree.pos = pos; return tree; } diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java index e1c2d5595c183..3d64c1fc15e8c 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeScanner.java @@ -304,8 +304,7 @@ public void visitTypeTest(JCInstanceOf tree) { } public void visitBindingPattern(JCBindingPattern tree) { - if (tree.vartype != null) - scan(tree.vartype); + scan(tree.var); } public void visitIndexed(JCArrayAccess tree) { diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java index 26fea8f0e4738..b6a5d6d447b7b 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeTranslator.java @@ -359,7 +359,7 @@ public void visitTypeTest(JCInstanceOf tree) { } public void visitBindingPattern(JCBindingPattern tree) { - tree.vartype = translate(tree.vartype); + tree.var = translate(tree.var); result = tree; } diff --git a/src/jdk.compiler/share/man/javac.1 b/src/jdk.compiler/share/man/javac.1 index a4ea5962b3cc8..1e2b536b35a1e 100644 --- a/src/jdk.compiler/share/man/javac.1 +++ b/src/jdk.compiler/share/man/javac.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JAVAC" "1" "2020" "JDK 15" "JDK Commands" +.TH "JAVAC" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.compiler/share/man/serialver.1 b/src/jdk.compiler/share/man/serialver.1 index f545187255742..140b940aad653 100644 --- a/src/jdk.compiler/share/man/serialver.1 +++ b/src/jdk.compiler/share/man/serialver.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "SERIALVER" "1" "2020" "JDK 15" "JDK Commands" +.TH "SERIALVER" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.hotspot.agent/share/man/jhsdb.1 b/src/jdk.hotspot.agent/share/man/jhsdb.1 index cf00c0627296a..c589196466860 100644 --- a/src/jdk.hotspot.agent/share/man/jhsdb.1 +++ b/src/jdk.hotspot.agent/share/man/jhsdb.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JHSDB" "1" "2020" "JDK 15" "JDK Commands" +.TH "JHSDB" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java index 43db2ab04747b..c393ce424a4d4 100644 --- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java +++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java @@ -75,7 +75,7 @@ public boolean equals(Object another) { * @return the contents of this principal in the form realm:username */ public String getName() { - return username; + return String.format("%s:%s", realm, username); } /** diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java index 650d3f048af04..b04b1fa4e8b0c 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java @@ -122,7 +122,11 @@ protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMC } private static RegisterConfig createRegisterConfig(AArch64HotSpotVMConfig config, TargetDescription target) { - return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops); + // ARMv8 defines r18 as being available to the platform ABI. Windows + // and Darwin use it for such. Linux doesn't assign it and thus r18 can + // be used as an additional register. + boolean canUsePlatformRegister = config.linuxOs; + return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops, canUsePlatformRegister); } protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) { diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java index 68213e7fed11e..72b13ff6ac6f6 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java @@ -34,6 +34,7 @@ import static jdk.vm.ci.aarch64.AArch64.rscratch1; import static jdk.vm.ci.aarch64.AArch64.rscratch2; import static jdk.vm.ci.aarch64.AArch64.r12; +import static jdk.vm.ci.aarch64.AArch64.r18; import static jdk.vm.ci.aarch64.AArch64.r27; import static jdk.vm.ci.aarch64.AArch64.r28; import static jdk.vm.ci.aarch64.AArch64.r29; @@ -122,15 +123,21 @@ public RegisterAttributes[] getAttributesMap() { */ public static final Register metaspaceMethodRegister = r12; + /** + * The platform ABI can use r18 to carry inter-procedural state (e.g. thread + * context). If not defined as such by the platform ABI, it can be used as + * additional temporary register. + */ + public static final Register platformRegister = r18; public static final Register heapBaseRegister = r27; public static final Register threadRegister = r28; public static final Register fp = r29; private static final RegisterArray reservedRegisters = new RegisterArray(rscratch1, rscratch2, threadRegister, fp, lr, r31, zr, sp); - private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase) { + private static RegisterArray initAllocatable(Architecture arch, boolean reserveForHeapBase, boolean canUsePlatformRegister) { RegisterArray allRegisters = arch.getAvailableValueRegisters(); - Register[] registers = new Register[allRegisters.size() - reservedRegisters.size() - (reserveForHeapBase ? 1 : 0)]; + Register[] registers = new Register[allRegisters.size() - reservedRegisters.size() - (reserveForHeapBase ? 1 : 0) - (!canUsePlatformRegister ? 1 : 0)]; List reservedRegistersList = reservedRegisters.asList(); int idx = 0; @@ -139,6 +146,9 @@ private static RegisterArray initAllocatable(Architecture arch, boolean reserveF // skip reserved registers continue; } + if (!canUsePlatformRegister && reg.equals(platformRegister)) { + continue; + } assert !(reg.equals(threadRegister) || reg.equals(fp) || reg.equals(lr) || reg.equals(r31) || reg.equals(zr) || reg.equals(sp)); if (reserveForHeapBase && reg.equals(heapBaseRegister)) { // skip heap base register @@ -152,8 +162,8 @@ private static RegisterArray initAllocatable(Architecture arch, boolean reserveF return new RegisterArray(registers); } - public AArch64HotSpotRegisterConfig(TargetDescription target, boolean useCompressedOops) { - this(target, initAllocatable(target.arch, useCompressedOops)); + public AArch64HotSpotRegisterConfig(TargetDescription target, boolean useCompressedOops, boolean canUsePlatformRegister) { + this(target, initAllocatable(target.arch, useCompressedOops, canUsePlatformRegister)); assert callerSaved.size() >= allocatable.size(); } diff --git a/src/jdk.jartool/share/man/jar.1 b/src/jdk.jartool/share/man/jar.1 index 58e658712ca6d..b1861c59330b9 100644 --- a/src/jdk.jartool/share/man/jar.1 +++ b/src/jdk.jartool/share/man/jar.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JAR" "1" "2020" "JDK 15" "JDK Commands" +.TH "JAR" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jartool/share/man/jarsigner.1 b/src/jdk.jartool/share/man/jarsigner.1 index 008c2d221c356..74001244a9f92 100644 --- a/src/jdk.jartool/share/man/jarsigner.1 +++ b/src/jdk.jartool/share/man/jarsigner.1 @@ -1,4 +1,3 @@ -.\"t .\" Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -8,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -20,9 +19,10 @@ .\" or visit www.oracle.com if you need additional information or have any .\" questions. .\" +.\"t .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JARSIGNER" "1" "2020" "JDK 15" "JDK Commands" +.TH "JARSIGNER" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP @@ -290,18 +290,20 @@ implementation, then change the line to the following: .SH SUPPORTED ALGORITHMS .PP By default, the \f[CB]jarsigner\f[R] command signs a JAR file using one of -the following algorithms files depending on the type and size of the -private key: +the following algorithms and block file extensions depending on the type +and size of the private key: .PP .TS tab(@); -l l l. +l l l l. T{ keyalg T}@T{ keysize T}@T{ default sigalg +T}@T{ +block file extension T} _ T{ @@ -310,6 +312,8 @@ T}@T{ any size T}@T{ SHA256withDSA +T}@T{ +\&.DSA T} T{ RSA @@ -317,18 +321,22 @@ T}@T{ <= 3072 T}@T{ SHA256withRSA +T}@T{ +\&.RSA T} T{ T}@T{ <= 7680 T}@T{ SHA384withRSA +T}@T{ T} T{ T}@T{ > 7680 T}@T{ SHA512withRSA +T}@T{ T} T{ EC @@ -336,20 +344,70 @@ T}@T{ < 384 T}@T{ SHA256withECDSA +T}@T{ +\&.EC T} T{ T}@T{ < 512 T}@T{ SHA384withECDSA +T}@T{ T} T{ T}@T{ = 512 T}@T{ SHA512withECDSA +T}@T{ +T} +T{ +RSASSA\-PSS +T}@T{ +<= 3072 +T}@T{ +RSASSA\-PSS (with SHA\-256) +T}@T{ +\&.RSA +T} +T{ +T}@T{ +<= 7680 +T}@T{ +RSASSA\-PSS (with SHA\-384) +T}@T{ +T} +T{ +T}@T{ +> 7680 +T}@T{ +RSASSA\-PSS (with SHA\-512) +T}@T{ +T} +T{ +EdDSA +T}@T{ +255 +T}@T{ +Ed25519 +T}@T{ +\&.EC +T} +T{ +T}@T{ +448 +T}@T{ +Ed448 +T}@T{ T} .TE +.IP \[bu] 2 +If an RSASSA\-PSS key is encoded with parameters, then jarsigner will +use the same parameters in the signature. +Otherwise, jarsigner will use parameters that are determined by the size +of the key as specified in the table above. +For example, an 3072\-bit RSASSA\-PSS key will use RSASSA\-PSS as the +signature algorithm and SHA\-256 as the hash and MGF1 algorithms. .PP These default signature algorithms can be overridden by using the \f[CB]\-sigalg\f[R] option. @@ -393,12 +451,13 @@ A signature block file with a \f[CB]\&.DSA\f[R], \f[CB]\&.RSA\f[R], or The base file names for these two files come from the value of the \f[CB]\-sigfile\f[R] option. For example, when the option is \f[CB]\-sigfile\ MKSIGN\f[R], the files -are named \f[CB]MKSIGN.SF\f[R] and \f[CB]MKSIGN.DSA\f[R] +are named \f[CB]MKSIGN.SF\f[R] and \f[CB]MKSIGN.RSA\f[R]. +In this document, we assume the signer always uses an RSA key. .PP If no \f[CB]\-sigfile\f[R] option appears on the command line, then the -base file name for the \f[CB]\&.SF\f[R] and \f[CB]\&.DSA\f[R] files is the -first 8 characters of the alias name specified on the command line, all -converted to uppercase. +base file name for the \f[CB]\&.SF\f[R] and the signature block files is +the first 8 characters of the alias name specified on the command line, +all converted to uppercase. If the alias name has fewer than 8 characters, then the full alias name is used. If the alias name contains any characters that aren\[aq]t allowed in a @@ -442,7 +501,8 @@ This file also contains, encoded inside it, the certificate or certificate chain from the keystore that authenticates the public key corresponding to the private key used for signing. The file has the extension \f[CB]\&.DSA\f[R], \f[CB]\&.RSA\f[R], or -\f[CB]\&.EC\f[R], depending on the digest algorithm used. +\f[CB]\&.EC\f[R], depending on the key algorithm used. +See the table in \f[B]Supported Algorithms\f[R]. .SH SIGNATURE TIME STAMP .PP The \f[CB]jarsigner\f[R] command used with the following options generates @@ -468,9 +528,9 @@ Verify the signature of the \f[CB]\&.SF\f[R] file. .RS 4 .PP The verification ensures that the signature stored in each signature -block (\f[CB]\&.DSA\f[R]) file was generated using the private key -corresponding to the public key whose certificate (or certificate chain) -also appears in the \f[CB]\&.DSA\f[R] file. +block file was generated using the private key corresponding to the +public key whose certificate (or certificate chain) also appears in the +signature block file. It also ensures that the signature is a valid signature of the corresponding signature (\f[CB]\&.SF\f[R]) file, and thus the \f[CB]\&.SF\f[R] file wasn\[aq]t tampered with. @@ -543,7 +603,7 @@ jarsigner\ myBundle.jar\ kevin .fi .PP When a JAR file is signed multiple times, there are multiple -\f[CB]\&.SF\f[R] and \f[CB]\&.DSA\f[R] files in the resulting JAR file, one +\f[CB]\&.SF\f[R] and signature block files in the resulting JAR file, one pair for each signature. In the previous example, the output JAR file includes files with the following names: @@ -551,9 +611,9 @@ following names: .nf \f[CB] SUSAN.SF -SUSAN.DSA +SUSAN.RSA KEVIN.SF -KEVIN.DSA +KEVIN.RSA \f[R] .fi .SH OPTIONS FOR JARSIGNER @@ -701,10 +761,10 @@ by \f[B]Internet RFC 1421 Certificate Encoding Standard\f[R] .TP .B \f[CB]\-sigfile\f[R] \f[I]file\f[R] Specifies the base file name to be used for the generated \f[CB]\&.SF\f[R] -and \f[CB]\&.DSA\f[R] files. +and signature block files. For example, if file is \f[CB]DUKESIGN\f[R], then the generated -\f[CB]\&.SF\f[R] and \f[CB]\&.DSA\f[R] files are named \f[CB]DUKESIGN.SF\f[R] -and \f[CB]DUKESIGN.DSA\f[R], and placed in the \f[CB]META\-INF\f[R] +\f[CB]\&.SF\f[R] and signature block files are named \f[CB]DUKESIGN.SF\f[R] +and \f[CB]DUKESIGN.RSA\f[R], and placed in the \f[CB]META\-INF\f[R] directory of the signed JAR file. .RS .PP @@ -712,10 +772,10 @@ The characters in the file must come from the set \f[CB]a\-zA\-Z0\-9_\-\f[R]. Only letters, numbers, underscore, and hyphen characters are allowed. All lowercase characters are converted to uppercase for the -\f[CB]\&.SF\f[R] and \f[CB]\&.DSA\f[R] file names. +\f[CB]\&.SF\f[R] and signature block file names. .PP If no \f[CB]\-sigfile\f[R] option appears on the command line, then the -base file name for the \f[CB]\&.SF\f[R] and \f[CB]\&.DSA\f[R] files is the +base file name for the \f[CB]\&.SF\f[R] and signature block files is the first 8 characters of the alias name specified on the command line, all converted to upper case. If the alias name has fewer than 8 characters, then the full alias name @@ -804,7 +864,7 @@ If the \f[CB]\-certs\f[R] option appears on the command line with the \f[CB]\-verify\f[R] and \f[CB]\-verbose\f[R] options, then the output includes certificate information for each signer of the JAR file. This information includes the name of the type of certificate (stored in -the \f[CB]\&.DSA\f[R] file) that certifies the signer\[aq]s public key, +the signature block file) that certifies the signer\[aq]s public key, and if the certificate is an X.509 certificate (an instance of the \f[CB]java.security.cert.X509Certificate\f[R]), then the distinguished name of the signer. @@ -885,11 +945,11 @@ Standard Algorithm Names. .RE .TP .B \f[CB]\-internalsf\f[R] -In the past, the \f[CB]\&.DSA\f[R] (signature block) file generated when a -JAR file was signed included a complete encoded copy of the -\f[CB]\&.SF\f[R] file (signature file) also generated. +In the past, the signature block file generated when a JAR file was +signed included a complete encoded copy of the \f[CB]\&.SF\f[R] file +(signature file) also generated. This behavior has been changed. -To reduce the overall size of the output JAR file, the \f[CB]\&.DSA\f[R] +To reduce the overall size of the output JAR file, the signature block file by default doesn\[aq]t contain a copy of the \f[CB]\&.SF\f[R] file anymore. If \f[CB]\-internalsf\f[R] appears on the command line, then the old @@ -900,6 +960,15 @@ incurs higher overhead. .RS .RE .TP +.B \f[CB]\-directsign\f[R] +By default, jarsigner stores the hash of the \f[CB]\&.SF\f[R] file and +possibly other information in a SignerInfo signedAttributes field, and +then calculates the signature on this field. +If this option is set, no SignerInfo signedAttributes field is generated +and the signature is calculated on the \f[CB]\&.SF\f[R] file directly. +.RS +.RE +.TP .B \f[CB]\-sectionsonly\f[R] If the \f[CB]\-sectionsonly\f[R] option appears on the command line, then the \f[CB]\&.SF\f[R] file (signature file) generated when a JAR file is @@ -1213,6 +1282,15 @@ Informational warnings include those that aren\[aq]t errors but regarded as bad practice. They don\[aq]t have a code. .TP +.B extraAttributesDetected +The POSIX file permissions and/or symlink attributes are detected during +signing or verifying a JAR file. +The \f[CB]jarsigner\f[R] tool preserves these attributes in the newly +signed file but warns that these attributes are unsigned and not +protected by the signature. +.RS +.RE +.TP .B hasExpiringCert This JAR contains entries whose signer certificate expires within six months. @@ -1251,9 +1329,9 @@ JAR file \f[CB]sbundle.jar\f[R]: .RE .PP There is no \f[CB]\-sigfile\f[R] specified in the previous command so the -generated \f[CB]\&.SF\f[R] and \f[CB]\&.DSA\f[R] files to be placed in the +generated \f[CB]\&.SF\f[R] and signature block files to be placed in the signed JAR file have default names based on the alias name. -They are named \f[CB]JANE.SF\f[R] and \f[CB]JANE.DSA\f[R]. +They are named \f[CB]JANE.SF\f[R] and \f[CB]JANE.RSA\f[R]. .PP If you want to be prompted for the store password and the private key password, then you could shorten the previous command to the following: diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java index 9c90da89e3d5b..c042fa7142972 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java @@ -46,8 +46,6 @@ */ public abstract class AbstractOverviewIndexWriter extends HtmlDocletWriter { - protected Navigation navBar; - /** * Constructs the AbstractOverviewIndexWriter. * @@ -57,32 +55,6 @@ public abstract class AbstractOverviewIndexWriter extends HtmlDocletWriter { public AbstractOverviewIndexWriter(HtmlConfiguration configuration, DocPath filename) { super(configuration, filename); - this.navBar = new Navigation(null, configuration, PageMode.OVERVIEW, path); - } - - /** - * Adds the top text (from the -top option), the upper - * navigation bar, and then the title (from the"-header" - * option), at the top of page. - * - * @param header the documentation tree to which the navigation bar header will be added - */ - protected void addNavigationBarHeader(Content header) { - addTop(header); - navBar.setUserHeader(getUserHeaderFooter(true)); - header.add(navBar.getContent(Navigation.Position.TOP)); - } - - /** - * Adds the lower navigation bar and the bottom text - * (from the -bottom option) at the bottom of page. - * - * @param footer the documentation tree to which the navigation bar footer will be added - */ - protected void addNavigationBarFooter(Content footer) { - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); } /** @@ -123,17 +95,13 @@ protected void buildOverviewIndexFile(String title, String description) throws DocFileIOException { String windowOverview = resources.getText(title); Content body = getBody(getWindowTitle(windowOverview)); - Content header = new ContentBuilder(); - addNavigationBarHeader(header); Content main = new ContentBuilder(); addOverviewHeader(main); addIndex(main); - Content footer = HtmlTree.FOOTER(); - addNavigationBarFooter(footer); body.add(new BodyContents() - .setHeader(header) + .setHeader(getHeader(PageMode.OVERVIEW)) .addMainContent(main) - .setFooter(footer)); + .setFooter(getFooter())); printHtmlDocument( configuration.metakeywords.getOverviewMetaKeywords(title, configuration.getOptions().docTitle()), description, body); 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 51df14460f41a..4aa825346674e 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 @@ -93,24 +93,15 @@ private static void generate(HtmlConfiguration configuration, IndexBuilder index */ protected void buildAllClassesFile() throws DocFileIOException { String label = resources.getText("doclet.All_Classes"); - Content header = new ContentBuilder(); - addTop(header); - Navigation navBar = new Navigation(null, configuration, PageMode.ALL_CLASSES, path); - navBar.setUserHeader(getUserHeaderFooter(true)); - header.add(navBar.getContent(Navigation.Position.TOP)); Content allClassesContent = new ContentBuilder(); addContents(allClassesContent); Content mainContent = new ContentBuilder(); mainContent.add(allClassesContent); - Content footer = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); HtmlTree bodyTree = getBody(getWindowTitle(label)); bodyTree.add(new BodyContents() - .setHeader(header) + .setHeader(getHeader(PageMode.ALL_CLASSES)) .addMainContent(mainContent) - .setFooter(footer)); + .setFooter(getFooter())); printHtmlDocument(null, "class index", bodyTree); } 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 5201002b5732a..4b8a0da9a97e9 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 @@ -74,27 +74,18 @@ private static void generate(HtmlConfiguration configuration, DocPath fileName) */ protected void buildAllPackagesFile() throws DocFileIOException { String label = resources.getText("doclet.All_Packages"); - Content headerContent = new ContentBuilder(); - Navigation navBar = new Navigation(null, configuration, PageMode.ALL_PACKAGES, path); - addTop(headerContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); Content mainContent = new ContentBuilder(); addPackages(mainContent); Content titleContent = contents.allPackagesLabel; Content pHeading = HtmlTree.HEADING_TITLE(Headings.PAGE_TITLE_HEADING, HtmlStyle.title, titleContent); Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading); - Content footer = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); HtmlTree bodyTree = getBody(getWindowTitle(label)); bodyTree.add(new BodyContents() - .setHeader(headerContent) + .setHeader(getHeader(PageMode.ALL_PACKAGES)) .addMainContent(headerDiv) .addMainContent(mainContent) - .setFooter(footer)); + .setFooter(getFooter())); printHtmlDocument(null, "package index", bodyTree); } 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 b83b9d54b7fbe..d87b8fab3ec6e 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 @@ -94,7 +94,6 @@ public class ClassUseWriter extends SubWriterHolderWriter { final ConstructorWriterImpl constrSubWriter; final FieldWriterImpl fieldSubWriter; final NestedClassWriterImpl classSubWriter; - private final Navigation navBar; /** * Constructor. @@ -147,7 +146,6 @@ public ClassUseWriter(HtmlConfiguration configuration, constrSubWriter.setFoundNonPubConstructor(true); fieldSubWriter = new FieldWriterImpl(this); classSubWriter = new NestedClassWriterImpl(this); - this.navBar = new Navigation(typeElement, configuration, PageMode.USE, path); } /** @@ -227,11 +225,7 @@ protected void generateClassUseFile() throws DocFileIOException { utils.getFullyQualifiedName(typeElement))); } bodyContents.addMainContent(mainContent); - HtmlTree footer = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); - bodyContents.setFooter(footer); + bodyContents.setFooter(getFooter()); body.add(bodyContents); String description = getDescription("use", typeElement); printHtmlDocument(null, description, body); @@ -425,17 +419,6 @@ protected HtmlTree getClassUseHeader() { String title = resources.getText("doclet.Window_ClassUse_Header", cltype, clname); HtmlTree bodyTree = getBody(getWindowTitle(title)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - Content mdleLinkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement), - contents.moduleLabel); - navBar.setNavLinkModule(mdleLinkContent); - Content classLinkContent = getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement) - .label(resources.getText("doclet.Class"))); - navBar.setNavLinkClass(classLinkContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); ContentBuilder headingContent = new ContentBuilder(); headingContent.add(contents.getContent("doclet.ClassUse_Title", cltype)); headingContent.add(new HtmlTree(TagName.BR)); @@ -443,7 +426,19 @@ protected HtmlTree getClassUseHeader() { Content heading = HtmlTree.HEADING_TITLE(Headings.PAGE_TITLE_HEADING, HtmlStyle.title, headingContent); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - bodyContents.setHeader(headerContent).addMainContent(div); + bodyContents.setHeader(getHeader(PageMode.USE, typeElement)).addMainContent(div); return bodyTree; } + + @Override + protected Navigation getNavBar(PageMode pageMode, Element element) { + Content mdleLinkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement), + contents.moduleLabel); + Content classLinkContent = getLink(new LinkInfoImpl( + configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, typeElement) + .label(resources.getText("doclet.Class"))); + return super.getNavBar(pageMode, element) + .setNavLinkModule(mdleLinkContent) + .setNavLinkClass(classLinkContent); + } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java index e8108101436e1..adf1c3554f40a 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java @@ -90,8 +90,6 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite protected final ClassTree classtree; - private final Navigation navBar; - /** * @param configuration the configuration data for the doclet * @param typeElement the class being documented. @@ -103,20 +101,11 @@ public ClassWriterImpl(HtmlConfiguration configuration, TypeElement typeElement, this.typeElement = typeElement; configuration.currentTypeElement = typeElement; this.classtree = classTree; - this.navBar = new Navigation(typeElement, configuration, PageMode.CLASS, path); } @Override public Content getHeader(String header) { HtmlTree bodyTree = getBody(getWindowTitle(utils.getSimpleName(typeElement))); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement), - contents.moduleLabel); - navBar.setNavLinkModule(linkContent); - navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); HtmlTree div = new HtmlTree(TagName.DIV); div.setStyle(HtmlStyle.header); if (configuration.showModules) { @@ -146,7 +135,7 @@ public Content getHeader(String header) { HtmlStyle.title, new StringContent(header)); heading.add(getTypeParameterLinks(linkInfo)); div.add(heading); - bodyContents.setHeader(headerContent) + bodyContents.setHeader(getHeader(PageMode.CLASS, typeElement)) .addMainContent(MarkerComments.START_OF_CLASS_DATA) .addMainContent(div); return bodyTree; @@ -157,14 +146,19 @@ public Content getClassContentHeader() { return getContentHeader(); } + @Override + protected Navigation getNavBar(PageMode pageMode, Element element) { + Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(element), + contents.moduleLabel); + return super.getNavBar(pageMode, element) + .setNavLinkModule(linkContent) + .setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); + } + @Override public void addFooter() { bodyContents.addMainContent(MarkerComments.END_OF_CLASS_DATA); - Content htmlTree = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - htmlTree.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(htmlTree); - bodyContents.setFooter(htmlTree); + bodyContents.setFooter(getFooter()); } @Override 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 f146cc55066f4..6c7d62f70f49d 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 @@ -73,8 +73,6 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons */ private HtmlTree summaryTree; - private final Navigation navBar; - private final BodyContents bodyContents = new BodyContents(); private boolean hasConstants = false; @@ -88,7 +86,6 @@ public ConstantsSummaryWriterImpl(HtmlConfiguration configuration) { super(configuration, DocPaths.CONSTANT_VALUES); constantsTableHeader = new TableHeader( contents.modifierAndTypeLabel, contents.constantFieldLabel, contents.valueLabel); - this.navBar = new Navigation(null, configuration, PageMode.CONSTANT_VALUES, path); configuration.conditionalPages.add(HtmlConfiguration.ConditionalPage.CONSTANT_VALUES); } @@ -96,11 +93,7 @@ public ConstantsSummaryWriterImpl(HtmlConfiguration configuration) { public Content getHeader() { String label = resources.getText("doclet.Constants_Summary"); HtmlTree bodyTree = getBody(getWindowTitle(label)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); - bodyContents.setHeader(headerContent); + bodyContents.setHeader(getHeader(PageMode.CONSTANT_VALUES)); return bodyTree; } @@ -271,11 +264,7 @@ public void addConstantSummaries(Content summariesTree) { @Override public void addFooter() { - Content htmlTree = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - htmlTree.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(htmlTree); - bodyContents.setFooter(htmlTree); + bodyContents.setFooter(getFooter()); } @Override diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java index 37063140e81a8..78bc189d29ba4 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java @@ -207,8 +207,6 @@ private String getHeaderKey(DeprElementKind kind) { private EnumMap writerMap; - private final Navigation navBar; - /** * Constructor. * @@ -218,7 +216,6 @@ private String getHeaderKey(DeprElementKind kind) { public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) { super(configuration, filename); - this.navBar = new Navigation(null, configuration, PageMode.DEPRECATED, path); NestedClassWriterImpl classW = new NestedClassWriterImpl(this); writerMap = new EnumMap<>(DeprElementKind.class); for (DeprElementKind kind : DeprElementKind.values()) { @@ -295,11 +292,7 @@ protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprAPI) } } bodyContents.addMainContent(content); - HtmlTree htmlTree = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - htmlTree.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(htmlTree); - bodyContents.setFooter(htmlTree); + bodyContents.setFooter(getFooter()); String description = "deprecated elements"; body.add(bodyContents); printHtmlDocument(null, description, body); @@ -356,11 +349,7 @@ public Content getContentsList(DeprecatedAPIListBuilder deprapi) { public HtmlTree getHeader() { String title = resources.getText("doclet.Window_Deprecated_List"); HtmlTree bodyTree = getBody(getWindowTitle(title)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); - bodyContents.setHeader(headerContent); + bodyContents.setHeader(getHeader(PageMode.DEPRECATED)); return bodyTree; } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java index 162b35a4dcf3f..93c18d341e377 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java @@ -64,7 +64,6 @@ public class DocFilesHandlerImpl implements DocFilesHandler { public final DocPath source; public final HtmlConfiguration configuration; private final HtmlOptions options; - private Navigation navBar; /** * Constructor to construct the DocFilesWriter object. @@ -196,7 +195,9 @@ private void handleHtmlFile(DocFile srcfile, DocPath dstPath) throws DocFileIOEx DocFileElement dfElement = new DocFileElement(utils, element, fileObject); DocPath dfilePath = dstPath.resolve(srcfile.getName()); - HtmlDocletWriter docletWriter = new DocFileWriter(configuration, dfilePath, element); + PackageElement pkg = dfElement.getPackageElement(); + + HtmlDocletWriter docletWriter = new DocFileWriter(configuration, dfilePath, element, pkg); configuration.messages.notice("doclet.Generating_0", docletWriter.filename.getPath()); List localTags = getLocalHeaderTags(utils.getPreamble(dfElement)); @@ -204,30 +205,15 @@ private void handleHtmlFile(DocFile srcfile, DocPath dstPath) throws DocFileIOEx String title = getWindowTitle(docletWriter, dfElement).trim(); HtmlTree htmlContent = docletWriter.getBody(title); - PackageElement pkg = dfElement.getPackageElement(); - this.navBar = new Navigation(element, configuration, PageMode.DOC_FILE, docletWriter.path); - Content headerContent = new ContentBuilder(); - docletWriter.addTop(headerContent); - Content mdleLinkContent = docletWriter.getModuleLink(utils.elementUtils.getModuleOf(pkg), - docletWriter.contents.moduleLabel); - navBar.setNavLinkModule(mdleLinkContent); - Content pkgLinkContent = docletWriter.getPackageLink(pkg, docletWriter.contents.packageLabel); - navBar.setNavLinkPackage(pkgLinkContent); - navBar.setUserHeader(docletWriter.getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); List fullBody = utils.getFullBody(dfElement); Content pageContent = docletWriter.commentTagsToContent(null, dfElement, fullBody, false); docletWriter.addTagsInfo(dfElement, pageContent); - navBar.setUserFooter(docletWriter.getUserHeaderFooter(false)); - Content footer = HtmlTree.FOOTER(); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - docletWriter.addBottom(footer); htmlContent.add(new BodyContents() - .setHeader(headerContent) + .setHeader(docletWriter.getHeader(PageMode.DOC_FILE, element)) .addMainContent(pageContent) - .setFooter(footer)); + .setFooter(docletWriter.getFooter())); docletWriter.printHtmlDocument(Collections.emptyList(), null, localTagsContent, Collections.emptyList(), htmlContent); } @@ -291,15 +277,17 @@ private String getWindowTitle(HtmlDocletWriter docletWriter, Element element) { } private static class DocFileWriter extends HtmlDocletWriter { + private final PackageElement pkg; /** * Constructor to construct the HtmlDocletWriter object. * - * @param configuration the configuration of this doclet. - * @param path the file to be generated. - * @param e the anchoring element. + * @param configuration the configuration of this doclet + * @param path the file to be generated + * @param e the anchoring element + * @param pkg the package containing the doc file */ - public DocFileWriter(HtmlConfiguration configuration, DocPath path, Element e) { + public DocFileWriter(HtmlConfiguration configuration, DocPath path, Element e, PackageElement pkg) { super(configuration, path); switch (e.getKind()) { case PACKAGE: @@ -308,6 +296,17 @@ public DocFileWriter(HtmlConfiguration configuration, DocPath path, Element e) { default: throw new AssertionError("unsupported element: " + e.getKind()); } + this.pkg = pkg; + } + + @Override + protected Navigation getNavBar(PageMode pageMode, Element element) { + Content mdleLinkContent = getModuleLink(utils.elementUtils.getModuleOf(element), + contents.moduleLabel); + Content pkgLinkContent = getPackageLink(pkg, contents.packageLabel); + return super.getNavBar(pageMode, element) + .setNavLinkModule(mdleLinkContent) + .setNavLinkPackage(pkgLinkContent); } } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java index 4f9124fdbb99a..6e8400e24f60f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java @@ -51,8 +51,6 @@ */ public class HelpWriter extends HtmlDocletWriter { - private final Navigation navBar; - private final String[][] SEARCH_EXAMPLES = { {"j.l.obj", "\"java.lang.Object\""}, {"InpStr", "\"java.io.InputStream\""}, @@ -67,7 +65,6 @@ public class HelpWriter extends HtmlDocletWriter { public HelpWriter(HtmlConfiguration configuration, DocPath filename) { super(configuration, filename); - this.navBar = new Navigation(null, configuration, PageMode.HELP, path); } /** @@ -93,20 +90,12 @@ public static void generate(HtmlConfiguration configuration) throws DocFileIOExc protected void generateHelpFile() throws DocFileIOException { String title = resources.getText("doclet.Window_Help_title"); HtmlTree body = getBody(getWindowTitle(title)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); ContentBuilder helpFileContent = new ContentBuilder(); addHelpFileContents(helpFileContent); - HtmlTree footer = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); body.add(new BodyContents() - .setHeader(headerContent) + .setHeader(getHeader(PageMode.HELP)) .addMainContent(helpFileContent) - .setFooter(footer)); + .setFooter(getFooter())); printHtmlDocument(null, "help", body); } 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 c51a058992947..4b3d2f9defdb1 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 @@ -487,46 +487,61 @@ public String getWindowTitle(String title) { } /** - * Get user specified header and the footer. + * Returns a {@code
            } element, containing the user "top" text, if any, + * amd the main navigation bar. * - * @param header if true print the user provided header else print the - * user provided footer. + * @param pageMode the pageMode used to configure the navigation bar + * + * @return the {@code
            } element */ - public Content getUserHeaderFooter(boolean header) { - String content; - if (header) { - content = replaceDocRootDir(options.header()); - } else { - if (options.footer().length() != 0) { - content = replaceDocRootDir(options.footer()); - } else { - content = replaceDocRootDir(options.header()); - } - } - Content rawContent = new RawHtml(content); - return rawContent; + protected HtmlTree getHeader(Navigation.PageMode pageMode) { + return getHeader(pageMode, null); + } + + /** + * Returns a {@code
            } element, containing the user "top" text, if any, + * amd the main navigation bar. + * + * @param pageMode the page mode used to configure the navigation bar + * @param element the element used to configure the navigation bar + * + * @return the {@code
            } element + */ + protected HtmlTree getHeader(Navigation.PageMode pageMode, Element element) { + return HtmlTree.HEADER() + .add(new RawHtml(replaceDocRootDir(options.top()))) + .add(getNavBar(pageMode, element).getContent()); } /** - * Adds the user specified top. + * Returns a basic navigation bar for a kind of page and element. + * + * @apiNote the result may be further configured by overriding this method * - * @param htmlTree the content tree to which user specified top will be added + * @param pageMode the page mode + * @param element the defining element for the navigation bar, or {@code null} if none + * @return the basic navigation bar */ - public void addTop(Content htmlTree) { - Content top = new RawHtml(replaceDocRootDir(options.top())); - htmlTree.add(top); + protected Navigation getNavBar(Navigation.PageMode pageMode, Element element) { + return new Navigation(element, configuration, pageMode, path) + .setUserHeader(new RawHtml(replaceDocRootDir(options.header()))); } /** - * Adds the user specified bottom. + * Returns a {@code
            } element containing the user's "bottom" text, + * or {@code null} if there is no such text. * - * @param htmlTree the content tree to which user specified bottom will be added + * @return the {@code
            } element or {@code null}. */ - public void addBottom(Content htmlTree) { - Content bottom = new RawHtml(replaceDocRootDir(options.bottom())); - Content small = HtmlTree.SMALL(bottom); - Content p = HtmlTree.P(HtmlStyle.legalCopy, small); - htmlTree.add(p); + public HtmlTree getFooter() { + String bottom = options.bottom(); + return (bottom == null || bottom.isEmpty()) + ? null + : HtmlTree.FOOTER() + .add(new HtmlTree(TagName.HR)) + .add(HtmlTree.P(HtmlStyle.legalCopy, + HtmlTree.SMALL( + new RawHtml(replaceDocRootDir(bottom))))); } /** diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java index 88fd3d6f00373..f7b19aed7e0ed 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java @@ -111,12 +111,6 @@ public class HtmlOptions extends BaseOptions { */ private String docTitle = ""; - - /** - * Argument for command-line option {@code -footer}. - */ - private String footer = ""; - /** * Argument for command-line option {@code -header}. */ @@ -235,7 +229,7 @@ public boolean process(String opt, List args) { new Option(resources, "-footer", 1) { @Override public boolean process(String opt, List args) { - footer = args.get(0); + messages.warning("doclet.footer_specified"); return true; } }, @@ -499,7 +493,6 @@ protected boolean validateOptions() { // to be handled here. Utils utils = config.utils; utils.checkJavaScriptInOption("-header", header); - utils.checkJavaScriptInOption("-footer", footer); utils.checkJavaScriptInOption("-top", top); utils.checkJavaScriptInOption("-bottom", bottom); utils.checkJavaScriptInOption("-doctitle", docTitle); @@ -593,13 +586,6 @@ String docTitle() { return docTitle; } - /** - * Argument for command-line option {@code -footer}. - */ - String footer() { - return footer; - } - /** * Argument for command-line option {@code -header}. */ diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java index 863a88db95eb7..1cc95cd18707d 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java @@ -123,28 +123,19 @@ protected void generateIndexFile(List allFirstCharacters, ? resources.getText("doclet.Window_Split_Index", displayFirstCharacters.get(0)) : resources.getText("doclet.Window_Single_Index"); HtmlTree body = getBody(getWindowTitle(title)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - Navigation navBar = new Navigation(null, configuration, PageMode.INDEX, path); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); Content mainContent = new ContentBuilder(); addLinksForIndexes(allFirstCharacters, mainContent); for (Character ch : displayFirstCharacters) { addContents(ch, mainIndex.getItems(ch), mainContent); } addLinksForIndexes(allFirstCharacters, mainContent); - HtmlTree footer = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); body.add(new BodyContents() - .setHeader(headerContent) + .setHeader(getHeader(PageMode.INDEX)) .addMainContent(HtmlTree.DIV(HtmlStyle.header, HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, contents.getContent("doclet.Index")))) .addMainContent(mainContent) - .setFooter(footer)); + .setFooter(getFooter())); String description = splitIndex ? "index: " + displayFirstCharacters.get(0) : "index"; printHtmlDocument(null, description, body); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java index 9a7826d77a0f5..a23cd867976c6 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MarkerComments.java @@ -43,24 +43,12 @@ public class MarkerComments { public static final Comment START_OF_TOP_NAVBAR = new Comment("========= START OF TOP NAVBAR ======="); - /** - * Marker to identify start of bottom navigation bar. - */ - public static final Comment START_OF_BOTTOM_NAVBAR = - new Comment("======= START OF BOTTOM NAVBAR ======"); - /** * Marker to identify end of top navigation bar. */ public static final Comment END_OF_TOP_NAVBAR = new Comment("========= END OF TOP NAVBAR ========="); - /** - * Marker to identify end of bottom navigation bar. - */ - public static final Comment END_OF_BOTTOM_NAVBAR = - new Comment("======== END OF BOTTOM NAVBAR ======="); - /** * Marker to identify start of module description. */ 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 1bc26ee63bffe..6c1b645bc286e 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 @@ -160,8 +160,6 @@ class PackageEntry { private final Map providesTrees = new TreeMap<>(comparators.makeAllClassesComparator()); - private final Navigation navBar; - private final BodyContents bodyContents = new BodyContents(); /** @@ -174,7 +172,6 @@ public ModuleWriterImpl(HtmlConfiguration configuration, ModuleElement mdle) { super(configuration, configuration.docPaths.moduleSummary(mdle)); this.mdle = mdle; this.moduleMode = configuration.docEnv.getModuleMode(); - this.navBar = new Navigation(mdle, configuration, PageMode.MODULE, path); computeModulesData(); } @@ -186,15 +183,6 @@ public ModuleWriterImpl(HtmlConfiguration configuration, ModuleElement mdle) { @Override public Content getModuleHeader(String heading) { HtmlTree bodyTree = getBody(getWindowTitle(mdle.getQualifiedName().toString())); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !options.noComment()); - navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules)); - navBar.setDisplaySummaryPackagesLink(display(packages) || display(indirectPackages) - || display(indirectOpenPackages)); - navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees)); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); HtmlTree div = new HtmlTree(TagName.DIV); div.setStyle(HtmlStyle.header); Content annotationContent = new HtmlTree(TagName.P); @@ -208,11 +196,21 @@ public Content getModuleHeader(String heading) { Content moduleHead = new RawHtml(heading); tHeading.add(moduleHead); div.add(tHeading); - bodyContents.setHeader(headerContent) + bodyContents.setHeader(getHeader(PageMode.MODULE, mdle)) .addMainContent(div); return bodyTree; } + @Override + protected Navigation getNavBar(PageMode pageMode, Element element) { + return super.getNavBar(pageMode, element) + .setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !options.noComment()) + .setDisplaySummaryModulesLink(display(requires) || display(indirectModules)) + .setDisplaySummaryPackagesLink(display(packages) || display(indirectPackages) + || display(indirectOpenPackages)) + .setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees)); + } + /** * Get the content header. */ @@ -840,11 +838,7 @@ public void addModuleContent(Content moduleContentTree) { @Override public void addModuleFooter() { - Content htmlTree = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - htmlTree.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(htmlTree); - bodyContents.setFooter(htmlTree); + bodyContents.setFooter(getFooter()); } @Override diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java index 3ce649ead92b2..31a40324d645f 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java @@ -80,7 +80,6 @@ public class Navigation { private boolean displaySummaryPackagesLink; private boolean displaySummaryServicesLink; private Content userHeader; - private Content userFooter; private final String rowListTitle; private final Content searchLabel; @@ -104,27 +103,6 @@ public enum PageMode { USE; } - enum Position { - BOTTOM(MarkerComments.START_OF_BOTTOM_NAVBAR, MarkerComments.END_OF_BOTTOM_NAVBAR), - TOP(MarkerComments.START_OF_TOP_NAVBAR, MarkerComments.END_OF_TOP_NAVBAR); - - final Content startOfNav; - final Content endOfNav; - - Position(Content startOfNav, Content endOfNav) { - this.startOfNav = startOfNav; - this.endOfNav = endOfNav; - } - - Content startOfNav() { - return startOfNav; - } - - Content endOfNav() { - return endOfNav; - } - } - /** * Creates a {@code Navigation} object for a specific file, to be written in a specific HTML * version. @@ -192,13 +170,8 @@ public Navigation setUserHeader(Content userHeader) { return this; } - public Navigation setUserFooter(Content userFooter) { - this.userFooter = userFooter; - return this; - } - /** - * Add the links for the main navigation. + * Adds the links for the main navigation. * * @param tree the content tree to which the main navigation will added */ @@ -356,7 +329,7 @@ private void addMainNavLinks(Content tree) { } /** - * Add the summary links to the sub-navigation. + * Adds the summary links to the sub-navigation. * * @param tree the content tree to which the sub-navigation will added */ @@ -436,7 +409,7 @@ private void addSummaryLinks(Content tree) { } /** - * Add the navigation summary link. + * Adds the navigation summary link. * * @param members members to be linked * @param vmt the visible member table @@ -461,7 +434,7 @@ private void addTypeSummaryLink(SortedSet members, } /** - * Add the navigation Type summary link. + * Adds the navigation Type summary link. * * @param typeElement the Type being documented * @param kind the kind of member being documented @@ -551,7 +524,7 @@ private void addTypeSummaryLink(TypeElement typeElement, VisibleMemberTable.Kind } /** - * Add the navigation Type summary link. + * Adds the navigation Type summary link. * * @param label the label to be added * @param kind the kind of member being documented @@ -598,7 +571,7 @@ private void addAnnotationTypeSummaryLink(String label, VisibleMemberTable.Kind } /** - * Add the detail links to sub-navigation. + * Adds the detail links to sub-navigation. * * @param tree the content tree to which the links will be added */ @@ -640,7 +613,7 @@ private void addDetailLinks(Content tree) { } /** - * Add the navigation Type detail link. + * Adds the navigation Type detail link. * * @param kind the kind of member being documented * @param link true if the members are listed and need to be linked @@ -689,7 +662,7 @@ protected void addTypeDetailLink(VisibleMemberTable.Kind kind, boolean link, Lis } /** - * Add the navigation Annotation Type detail link. + * Adds the navigation Annotation Type detail link. * * @param listContents the list of contents to which the annotation detail will be added. */ @@ -723,7 +696,7 @@ protected void addAnnotationTypeDetailLink(List listContents) { } /** - * Add the navigation Annotation Type detail link. + * Adds the navigation Annotation Type detail link. * * @param type the kind of member being documented * @param link true if the member details need to be linked @@ -906,12 +879,11 @@ private void addSearch(Content tree) { } /** - * Get the navigation content. + * Returns the navigation content. * - * @param posn the position for the navigation bar - * @return the navigation contents + * @return the navigation content */ - public Content getContent(Position posn) { + public Content getContent() { if (options.noNavbar()) { return new ContentBuilder(); } @@ -919,37 +891,15 @@ public Content getContent(Position posn) { HtmlTree navDiv = new HtmlTree(TagName.DIV); Content skipNavLinks = contents.getContent("doclet.Skip_navigation_links"); - SectionName navListSection; - Content aboutContent; - boolean addSearch; - switch (posn) { - case TOP: - tree.add(Position.TOP.startOfNav()); - navDiv.setStyle(HtmlStyle.topNav) - .setId(SectionName.NAVBAR_TOP.getName()) - .add(HtmlTree.DIV(HtmlStyle.skipNav, - links.createLink(SectionName.SKIP_NAVBAR_TOP, skipNavLinks, - skipNavLinks.toString(), ""))); - navListSection = SectionName.NAVBAR_TOP_FIRSTROW; - aboutContent = userHeader; - addSearch = options.createIndex(); - break; - - case BOTTOM: - tree.add(Position.BOTTOM.startOfNav()); - navDiv.setStyle(HtmlStyle.bottomNav) - .setId(SectionName.NAVBAR_BOTTOM.getName()) - .add(HtmlTree.DIV(HtmlStyle.skipNav, - links.createLink(SectionName.SKIP_NAVBAR_BOTTOM, skipNavLinks, - skipNavLinks.toString(), ""))); - navListSection = SectionName.NAVBAR_BOTTOM_FIRSTROW; - aboutContent = userFooter; - addSearch = false; - break; - - default: - throw new Error(); - } + tree.add(MarkerComments.START_OF_TOP_NAVBAR); + navDiv.setStyle(HtmlStyle.topNav) + .setId(SectionName.NAVBAR_TOP.getName()) + .add(HtmlTree.DIV(HtmlStyle.skipNav, + links.createLink(SectionName.SKIP_NAVBAR_TOP, skipNavLinks, + skipNavLinks.toString(), ""))); + SectionName navListSection = SectionName.NAVBAR_TOP_FIRSTROW; + Content aboutContent = userHeader; + boolean addSearch = options.createIndex(); HtmlTree navList = new HtmlTree(TagName.UL) .setId(navListSection.getName()) @@ -979,18 +929,10 @@ public Content getContent(Position posn) { } tree.add(subDiv); - switch (posn) { - case TOP: - tree.add(Position.TOP.endOfNav()); - tree.add(HtmlTree.SPAN(HtmlStyle.skipNav, EMPTY_COMMENT) - .setId(SectionName.SKIP_NAVBAR_TOP.getName())); - break; + tree.add(MarkerComments.END_OF_TOP_NAVBAR); + tree.add(HtmlTree.SPAN(HtmlStyle.skipNav, EMPTY_COMMENT) + .setId(SectionName.SKIP_NAVBAR_TOP.getName())); - case BOTTOM: - tree.add(Position.BOTTOM.endOfNav()); - tree.add(HtmlTree.SPAN(HtmlStyle.skipNav, EMPTY_COMMENT) - .setId(SectionName.SKIP_NAVBAR_BOTTOM.getName())); - } return tree; } } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java index 6120e08b4aee1..95d2f207af9a3 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageTreeWriter.java @@ -25,6 +25,7 @@ package jdk.javadoc.internal.doclets.formats.html; +import javax.lang.model.element.Element; import javax.lang.model.element.PackageElement; import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents; @@ -56,8 +57,6 @@ public class PackageTreeWriter extends AbstractTreeWriter { */ protected PackageElement packageElement; - private final Navigation navBar; - private final BodyContents bodyContents = new BodyContents(); /** @@ -70,7 +69,6 @@ public PackageTreeWriter(HtmlConfiguration configuration, DocPath path, PackageE super(configuration, path, new ClassTree(configuration.typeElementCatalog.allClasses(packageElement), configuration)); this.packageElement = packageElement; - this.navBar = new Navigation(packageElement, configuration, PageMode.TREE, path); } /** @@ -112,11 +110,7 @@ protected void generatePackageTreeFile() throws DocFileIOException { addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", mainContent); addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", mainContent, true); bodyContents.addMainContent(mainContent); - HtmlTree footer = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); - bodyContents.setFooter(footer); + bodyContents.setFooter(getFooter()); body.add(bodyContents); printHtmlDocument(null, getDescription("tree", packageElement), body); } @@ -130,15 +124,16 @@ protected HtmlTree getPackageTreeHeader() { String packageName = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement); String title = packageName + " " + resources.getText("doclet.Window_Class_Hierarchy"); HtmlTree bodyTree = getBody(getWindowTitle(title)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); + bodyContents.setHeader(getHeader(PageMode.TREE, packageElement)); + return bodyTree; + } + + @Override + protected Navigation getNavBar(PageMode pageMode, Element element) { Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), contents.moduleLabel); - navBar.setNavLinkModule(linkContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); - bodyContents.setHeader(headerContent); - return bodyTree; + return super.getNavBar(pageMode, element) + .setNavLinkModule(linkContent); } /** 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 9e219b72c25fc..365ff890e6ebc 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 @@ -30,6 +30,7 @@ import java.util.TreeMap; import java.util.TreeSet; +import javax.lang.model.element.Element; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; @@ -61,7 +62,6 @@ public class PackageUseWriter extends SubWriterHolderWriter { final PackageElement packageElement; final SortedMap> usingPackageToUsedClasses = new TreeMap<>(); final String packageUseTableSummary; - private final Navigation navBar; /** * Constructor. @@ -99,7 +99,6 @@ public PackageUseWriter(HtmlConfiguration configuration, packageUseTableSummary = resources.getText("doclet.Use_Table_Summary", resources.getText("doclet.packages")); - this.navBar = new Navigation(packageElement, configuration, PageMode.USE, path); } /** @@ -131,11 +130,7 @@ protected void generatePackageUseFile() throws DocFileIOException { addPackageUse(mainContent); } bodyContents.addMainContent(mainContent); - HtmlTree footer = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); - bodyContents.setFooter(footer); + bodyContents.setFooter(getFooter()); body.add(bodyContents); printHtmlDocument(null, getDescription("use", packageElement), @@ -236,13 +231,6 @@ private HtmlTree getPackageUseHeader() { String name = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement); String title = resources.getText("doclet.Window_ClassUse_Header", packageText, name); HtmlTree bodyTree = getBody(getWindowTitle(title)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), - contents.moduleLabel); - navBar.setNavLinkModule(linkContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); ContentBuilder headingContent = new ContentBuilder(); headingContent.add(contents.getContent("doclet.ClassUse_Title", packageText)); headingContent.add(new HtmlTree(TagName.BR)); @@ -250,8 +238,16 @@ private HtmlTree getPackageUseHeader() { Content heading = HtmlTree.HEADING_TITLE(Headings.PAGE_TITLE_HEADING, HtmlStyle.title, headingContent); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - bodyContents.setHeader(headerContent) + bodyContents.setHeader(getHeader(PageMode.USE, packageElement)) .addMainContent(div); return bodyTree; } + + @Override + protected Navigation getNavBar(PageMode pageMode, Element element) { + Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(element), + contents.moduleLabel); + return super.getNavBar(pageMode, element) + .setNavLinkModule(linkContent); + } } 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 2940b37fd17a9..89170e24da992 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 @@ -28,6 +28,7 @@ import java.util.List; import java.util.SortedSet; +import javax.lang.model.element.Element; import javax.lang.model.element.ModuleElement; import javax.lang.model.element.PackageElement; import javax.lang.model.element.TypeElement; @@ -74,8 +75,6 @@ public class PackageWriterImpl extends HtmlDocletWriter */ protected HtmlTree sectionTree = HtmlTree.SECTION(HtmlStyle.packageDescription, new ContentBuilder()); - private final Navigation navBar; - private final BodyContents bodyContents = new BodyContents(); /** @@ -94,19 +93,11 @@ public PackageWriterImpl(HtmlConfiguration configuration, PackageElement package configuration.docPaths.forPackage(packageElement) .resolve(DocPaths.PACKAGE_SUMMARY)); this.packageElement = packageElement; - this.navBar = new Navigation(packageElement, configuration, PageMode.PACKAGE, path); } @Override public Content getPackageHeader(String heading) { HtmlTree bodyTree = getBody(getWindowTitle(utils.getPackageName(packageElement))); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), - contents.moduleLabel); - navBar.setNavLinkModule(linkContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); HtmlTree div = new HtmlTree(TagName.DIV); div.setStyle(HtmlStyle.header); if (configuration.showModules) { @@ -127,7 +118,7 @@ public Content getPackageHeader(String heading) { Content packageHead = new StringContent(heading); tHeading.add(packageHead); div.add(tHeading); - bodyContents.setHeader(headerContent) + bodyContents.setHeader(getHeader(PageMode.PACKAGE, packageElement)) .addMainContent(div); return bodyTree; } @@ -137,6 +128,14 @@ public Content getContentHeader() { return new ContentBuilder(); } + @Override + protected Navigation getNavBar(PageMode pageMode, Element element) { + Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), + contents.moduleLabel); + return super.getNavBar(pageMode, element) + .setNavLinkModule(linkContent); + } + /** * Add the package deprecation information to the documentation tree. * @@ -261,11 +260,7 @@ public void addPackageContent(Content packageContentTree) { @Override public void addPackageFooter() { - Content htmlTree = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - htmlTree.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(htmlTree); - bodyContents.setFooter(htmlTree); + bodyContents.setFooter(getFooter()); } @Override diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java index 3aa0db00fbe5a..975d2aa8f3981 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java @@ -55,15 +55,12 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter Set visibleClasses; - private final Navigation navBar; - /** * @param configuration the configuration data for the doclet */ public SerializedFormWriterImpl(HtmlConfiguration configuration) { super(configuration, DocPaths.SERIALIZED_FORM); visibleClasses = configuration.getIncludedTypeElements(); - this.navBar = new Navigation(null, configuration, PageMode.SERIALIZED_FORM, path); configuration.conditionalPages.add(HtmlConfiguration.ConditionalPage.SERIALIZED_FORM); } @@ -76,15 +73,11 @@ public SerializedFormWriterImpl(HtmlConfiguration configuration) { @Override public Content getHeader(String header) { HtmlTree bodyTree = getBody(getWindowTitle(header)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); Content h1Content = new StringContent(header); Content heading = HtmlTree.HEADING_TITLE(Headings.PAGE_TITLE_HEADING, HtmlStyle.title, h1Content); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - bodyContents.setHeader(headerContent) + bodyContents.setHeader(getHeader(PageMode.SERIALIZED_FORM)) .addMainContent(div); return bodyTree; } @@ -241,11 +234,7 @@ public void addPackageSerializedTree(Content serializedSummariesTree, */ @Override public void addFooter() { - Content htmlTree = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - htmlTree.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(htmlTree); - bodyContents.setFooter(htmlTree); + bodyContents.setFooter(getFooter()); } @Override 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 503eeb10b6e73..c17997c651050 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 @@ -63,8 +63,6 @@ */ public class SystemPropertiesWriter extends HtmlDocletWriter { - private final Navigation navBar; - /** * Cached contents of {@code ...} tags of the HTML pages. */ @@ -78,7 +76,6 @@ public class SystemPropertiesWriter extends HtmlDocletWriter { */ public SystemPropertiesWriter(HtmlConfiguration configuration, DocPath filename) { super(configuration, filename); - this.navBar = new Navigation(null, configuration, PageMode.SYSTEM_PROPERTIES, path); } public static void generate(HtmlConfiguration configuration) throws DocFileIOException { @@ -108,23 +105,15 @@ private static void generate(HtmlConfiguration configuration, DocPath fileName) protected void buildSystemPropertiesPage() throws DocFileIOException { String title = resources.getText("doclet.systemProperties"); HtmlTree body = getBody(getWindowTitle(title)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); Content mainContent = new ContentBuilder(); addSystemProperties(mainContent); - Content footer = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footer.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footer); body.add(new BodyContents() - .setHeader(headerContent) + .setHeader(getHeader(PageMode.SYSTEM_PROPERTIES)) .addMainContent(HtmlTree.DIV(HtmlStyle.header, HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, contents.getContent("doclet.systemProperties")))) .addMainContent(mainContent) - .setFooter(footer)); + .setFooter(getFooter())); printHtmlDocument(null, "system properties", body); if (configuration.mainIndex != null) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java index 1fe0a5292e46e..0dbe9c790b5ac 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java @@ -66,8 +66,6 @@ public class TreeWriter extends AbstractTreeWriter { */ private final boolean classesOnly; - private final Navigation navBar; - protected BodyContents bodyContents; /** @@ -81,7 +79,6 @@ public TreeWriter(HtmlConfiguration configuration, DocPath filename, ClassTree c super(configuration, filename, classtree); packages = configuration.packages; classesOnly = packages.isEmpty(); - this.navBar = new Navigation(null, configuration, PageMode.TREE, path); this.bodyContents = new BodyContents(); } @@ -118,13 +115,9 @@ public void generateTreeFile() throws DocFileIOException { addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", mainContent); addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", mainContent); addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", mainContent, true); - HtmlTree footerTree = HtmlTree.FOOTER(); - navBar.setUserFooter(getUserHeaderFooter(false)); - footerTree.add(navBar.getContent(Navigation.Position.BOTTOM)); - addBottom(footerTree); body.add(bodyContents .addMainContent(mainContent) - .setFooter(footerTree)); + .setFooter(getFooter())); printHtmlDocument(null, "class tree", body); } @@ -175,11 +168,7 @@ protected void addPackageTreeLinks(Content contentTree) { protected HtmlTree getTreeHeader() { String title = resources.getText("doclet.Window_Class_Hierarchy"); HtmlTree bodyTree = getBody(getWindowTitle(title)); - Content headerContent = new ContentBuilder(); - addTop(headerContent); - navBar.setUserHeader(getUserHeaderFooter(true)); - headerContent.add(navBar.getContent(Navigation.Position.TOP)); - bodyContents.setHeader(headerContent); + bodyContents.setHeader(getHeader(PageMode.TREE)); return bodyTree; } diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/BodyContents.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/BodyContents.java index 63f2dfc177843..33ebbc43b2d2c 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/BodyContents.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/BodyContents.java @@ -31,6 +31,7 @@ import java.io.Writer; import java.util.ArrayList; import java.util.List; +import java.util.Objects; /** * Content for the {@code } element. @@ -47,20 +48,20 @@ public class BodyContents extends Content { private List mainContents = new ArrayList<>(); - private Content header = HtmlTree.EMPTY; - private Content footer = HtmlTree.EMPTY; + private HtmlTree header = null; + private HtmlTree footer = null; public BodyContents addMainContent(Content content) { mainContents.add(content); return this; } - public BodyContents setHeader(Content header) { - this.header = header; + public BodyContents setHeader(HtmlTree header) { + this.header = Objects.requireNonNull(header); return this; } - public BodyContents setFooter(Content footer) { + public BodyContents setFooter(HtmlTree footer) { this.footer = footer; return this; } @@ -88,13 +89,14 @@ public boolean write(Writer out, boolean atNewline) throws IOException { * @return the HTML */ private Content toContent() { - HtmlTree flexHeader = HtmlTree.HEADER() - .setStyle(HtmlStyle.flexHeader) - .add(header); + if (header == null) + throw new NullPointerException(); + + HtmlTree flexHeader = header.addStyle(HtmlStyle.flexHeader); HtmlTree flexContent = HtmlTree.DIV(HtmlStyle.flexContent) .add(HtmlTree.MAIN().add(mainContents)) - .add(footer); + .add(footer == null ? HtmlTree.EMPTY : footer); return HtmlTree.DIV(HtmlStyle.flexBox) .add(flexHeader) 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 ace4257226f71..28791eb7a023b 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 @@ -97,11 +97,6 @@ public enum HtmlStyle { */ topNav, - /** - * The class for the overall {@code div} element containing the {@code footer} element for the page. - */ - bottomNav, - /** * The class for the element containing the information (such as the product name and version) * provided by the {@code -header} or {@code -footer} command line option. diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties index 3a8fcc0948ffb..0846a2ff64df0 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties @@ -491,7 +491,12 @@ doclet.usage.xdoclint-package.description=\ of the given package. Prefix the package specifier with - to\n\ disable checks for the specified packages. -# L10N: do not localize the option names --no-frames +# L10N: do not localize the option name --no-frames doclet.NoFrames_specified=\ The --no-frames option is no longer required and may be removed\n\ in a future release. + +# L10N: do not localize the option name -footer +doclet.footer_specified=\ + The -footer option is no longer supported and will be ignored.\n\ + It may be removed in a future release. \ No newline at end of file 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 a4fd5d659f9ba..de894ea81e959 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 @@ -152,19 +152,6 @@ button { overflow:hidden; font-size:12px; } -.bottom-nav { - margin-top:10px; - background-color:#4D7A97; - color:#FFFFFF; - float:left; - padding:0; - width:100%; - clear:right; - height:2.8em; - padding-top:10px; - overflow:hidden; - font-size:12px; -} .sub-nav { background-color:#dee3e9; float:left; @@ -207,12 +194,12 @@ ul.sub-nav-list li { float:left; padding-top:10px; } -.top-nav a:link, .top-nav a:active, .top-nav a:visited, .bottom-nav a:link, .bottom-nav a:active, .bottom-nav a:visited { +.top-nav a:link, .top-nav a:active, .top-nav a:visited { color:#FFFFFF; text-decoration:none; text-transform:uppercase; } -.top-nav a:hover, .bottom-nav a:hover { +.top-nav a:hover { text-decoration:none; color:#bb7a2a; text-transform:uppercase; diff --git a/src/jdk.javadoc/share/man/javadoc.1 b/src/jdk.javadoc/share/man/javadoc.1 index a0fc1354141d3..14139d20ef2f1 100644 --- a/src/jdk.javadoc/share/man/javadoc.1 +++ b/src/jdk.javadoc/share/man/javadoc.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JAVADOC" "1" "2020" "JDK 15" "JDK Commands" +.TH "JAVADOC" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jcmd/share/man/jcmd.1 b/src/jdk.jcmd/share/man/jcmd.1 index 9e6a99bd2539e..5ab057c1453aa 100644 --- a/src/jdk.jcmd/share/man/jcmd.1 +++ b/src/jdk.jcmd/share/man/jcmd.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JCMD" "1" "2020" "JDK 15" "JDK Commands" +.TH "JCMD" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jcmd/share/man/jinfo.1 b/src/jdk.jcmd/share/man/jinfo.1 index a78f5b2e172cc..f7f79ab296ee9 100644 --- a/src/jdk.jcmd/share/man/jinfo.1 +++ b/src/jdk.jcmd/share/man/jinfo.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JINFO" "1" "2020" "JDK 15" "JDK Commands" +.TH "JINFO" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jcmd/share/man/jmap.1 b/src/jdk.jcmd/share/man/jmap.1 index eb0c92b0775ce..b5284e0f9e03e 100644 --- a/src/jdk.jcmd/share/man/jmap.1 +++ b/src/jdk.jcmd/share/man/jmap.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JMAP" "1" "2020" "JDK 15" "JDK Commands" +.TH "JMAP" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jcmd/share/man/jps.1 b/src/jdk.jcmd/share/man/jps.1 index b754ce042a9d2..75acc38ced047 100644 --- a/src/jdk.jcmd/share/man/jps.1 +++ b/src/jdk.jcmd/share/man/jps.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JPS" "1" "2020" "JDK 15" "JDK Commands" +.TH "JPS" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jcmd/share/man/jstack.1 b/src/jdk.jcmd/share/man/jstack.1 index ebc294928a2e6..98269bcaf8c60 100644 --- a/src/jdk.jcmd/share/man/jstack.1 +++ b/src/jdk.jcmd/share/man/jstack.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JSTACK" "1" "2020" "JDK 15" "JDK Commands" +.TH "JSTACK" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jcmd/share/man/jstat.1 b/src/jdk.jcmd/share/man/jstat.1 index 7623a3769a5ce..143d3ce8d4ff3 100644 --- a/src/jdk.jcmd/share/man/jstat.1 +++ b/src/jdk.jcmd/share/man/jstat.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JSTAT" "1" "2020" "JDK 15" "JDK Commands" +.TH "JSTAT" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP @@ -224,7 +224,7 @@ Class loader statistics. .PP \f[CB]Unloaded\f[R]: Number of classes unloaded. .PP -\f[CB]Bytes\f[R]: Number of KB loaded. +\f[CB]Bytes\f[R]: Number of KB unloaded. .PP \f[CB]Time\f[R]: Time spent performing class loading and unloading operations. diff --git a/src/jdk.jconsole/share/man/jconsole.1 b/src/jdk.jconsole/share/man/jconsole.1 index da8196d9e05ca..277cf03443336 100644 --- a/src/jdk.jconsole/share/man/jconsole.1 +++ b/src/jdk.jconsole/share/man/jconsole.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JCONSOLE" "1" "2020" "JDK 15" "JDK Commands" +.TH "JCONSOLE" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jdeps/share/man/javap.1 b/src/jdk.jdeps/share/man/javap.1 index d19f23559c634..3bef06a924e1f 100644 --- a/src/jdk.jdeps/share/man/javap.1 +++ b/src/jdk.jdeps/share/man/javap.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JAVAP" "1" "2020" "JDK 15" "JDK Commands" +.TH "JAVAP" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jdeps/share/man/jdeprscan.1 b/src/jdk.jdeps/share/man/jdeprscan.1 index c4ca77319a500..3dd4cd9097e7e 100644 --- a/src/jdk.jdeps/share/man/jdeprscan.1 +++ b/src/jdk.jdeps/share/man/jdeprscan.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JDEPRSCAN" "1" "2020" "JDK 15" "JDK Commands" +.TH "JDEPRSCAN" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jdeps/share/man/jdeps.1 b/src/jdk.jdeps/share/man/jdeps.1 index 3a08fe64406cf..3dd37bd715075 100644 --- a/src/jdk.jdeps/share/man/jdeps.1 +++ b/src/jdk.jdeps/share/man/jdeps.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JDEPS" "1" "2020" "JDK 15" "JDK Commands" +.TH "JDEPS" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jdi/share/man/jdb.1 b/src/jdk.jdi/share/man/jdb.1 index 6f6d6c4e95da6..00969b55e4504 100644 --- a/src/jdk.jdi/share/man/jdb.1 +++ b/src/jdk.jdi/share/man/jdb.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 1995, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" .\" This code is free software; you can redistribute it and/or modify it @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JDB" "1" "2020" "JDK 15" "JDK Commands" +.TH "JDB" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c b/src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c index 96773392fc375..40dd5d1003c3f 100644 --- a/src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c +++ b/src/jdk.jdwp.agent/share/native/libjdwp/threadControl.c @@ -84,6 +84,9 @@ typedef struct ThreadNode { struct ThreadNode *prev; jlong frameGeneration; struct ThreadList *list; /* Tells us what list this thread is in */ +#ifdef DEBUG_THREADNAME + char name[256]; +#endif } ThreadNode; static jint suspendAllCount; @@ -349,6 +352,22 @@ insertThread(JNIEnv *env, ThreadList *list, jthread thread) node->eventBag = eventBag; addNode(list, node); +#ifdef DEBUG_THREADNAME + { + /* Set the thread name */ + jvmtiThreadInfo info; + jvmtiError error; + + memset(&info, 0, sizeof(info)); + error = JVMTI_FUNC_PTR(gdata->jvmti,GetThreadInfo) + (gdata->jvmti, node->thread, &info); + if (info.name != NULL) { + strncpy(node->name, info.name, sizeof(node->name) - 1); + jvmtiDeallocate(info.name); + } + } +#endif + /* Set thread local storage for quick thread -> node access. * Some threads may not be in a state that allows setting of TLS, * which is ok, see findThread, it deals with threads without TLS set. diff --git a/src/jdk.jfr/share/man/jfr.1 b/src/jdk.jfr/share/man/jfr.1 index ace59a458528c..0fb8912b6714c 100644 --- a/src/jdk.jfr/share/man/jfr.1 +++ b/src/jdk.jfr/share/man/jfr.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. +.\" 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 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JFR" "1" "2020" "JDK 15" "JDK Commands" +.TH "JFR" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jlink/share/man/jlink.1 b/src/jdk.jlink/share/man/jlink.1 index 631b1b0d147bf..a782d558b438c 100644 --- a/src/jdk.jlink/share/man/jlink.1 +++ b/src/jdk.jlink/share/man/jlink.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2017, 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 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JLINK" "1" "2020" "JDK 15" "JDK Commands" +.TH "JLINK" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jlink/share/man/jmod.1 b/src/jdk.jlink/share/man/jmod.1 index 5b089d8d357b1..d46f870847850 100644 --- a/src/jdk.jlink/share/man/jmod.1 +++ b/src/jdk.jlink/share/man/jmod.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JMOD" "1" "2020" "JDK 15" "JDK Commands" +.TH "JMOD" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/DesktopIntegration.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/DesktopIntegration.java similarity index 96% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/DesktopIntegration.java rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/DesktopIntegration.java index 9396bfb93c336..9311d9dc282f6 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/DesktopIntegration.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/DesktopIntegration.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.awt.image.BufferedImage; import java.io.BufferedReader; @@ -46,16 +46,16 @@ import javax.imageio.ImageIO; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import jdk.incubator.jpackage.internal.Arguments.CLIOptions; -import static jdk.incubator.jpackage.internal.LinuxAppImageBuilder.DEFAULT_ICON; -import static jdk.incubator.jpackage.internal.LinuxAppImageBuilder.ICON_PNG; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.DESCRIPTION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FILE_ASSOCIATIONS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ICON; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE; +import jdk.jpackage.internal.Arguments.CLIOptions; +import static jdk.jpackage.internal.LinuxAppImageBuilder.DEFAULT_ICON; +import static jdk.jpackage.internal.LinuxAppImageBuilder.ICON_PNG; +import static jdk.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.DESCRIPTION; +import static jdk.jpackage.internal.StandardBundlerParam.FILE_ASSOCIATIONS; +import static jdk.jpackage.internal.StandardBundlerParam.ICON; +import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE; /** * Helper to create files for desktop integration. diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LibProvidersLookup.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LibProvidersLookup.java similarity index 91% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LibProvidersLookup.java rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LibProvidersLookup.java index aa0b3bbf85274..10df465a0fbcc 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LibProvidersLookup.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LibProvidersLookup.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; @@ -153,17 +153,17 @@ public interface PackageLookup { // // Typical ldd output: // - // ldd: warning: you do not have execution permission for `/tmp/jdk.incubator.jpackage17911687595930080396/images/opt/simplepackagetest/lib/runtime/lib/libawt_headless.so' + // ldd: warning: you do not have execution permission for `/tmp/jdk.jpackage17911687595930080396/images/opt/simplepackagetest/lib/runtime/lib/libawt_headless.so' // linux-vdso.so.1 => (0x00007ffce6bfd000) - // libawt.so => /tmp/jdk.incubator.jpackage17911687595930080396/images/opt/simplepackagetest/lib/runtime/lib/libawt.so (0x00007f4e00c75000) + // libawt.so => /tmp/jdk.jpackage17911687595930080396/images/opt/simplepackagetest/lib/runtime/lib/libawt.so (0x00007f4e00c75000) // libjvm.so => not found - // libjava.so => /tmp/jdk.incubator.jpackage17911687595930080396/images/opt/simplepackagetest/lib/runtime/lib/libjava.so (0x00007f4e00c41000) + // libjava.so => /tmp/jdk.jpackage17911687595930080396/images/opt/simplepackagetest/lib/runtime/lib/libjava.so (0x00007f4e00c41000) // libm.so.6 => /lib64/libm.so.6 (0x00007f4e00834000) // libdl.so.2 => /lib64/libdl.so.2 (0x00007f4e00630000) // libc.so.6 => /lib64/libc.so.6 (0x00007f4e00262000) // libjvm.so => not found // libjvm.so => not found - // libverify.so => /tmp/jdk.incubator.jpackage17911687595930080396/images/opt/simplepackagetest/lib/runtime/lib/libverify.so (0x00007f4e00c2e000) + // libverify.so => /tmp/jdk.jpackage17911687595930080396/images/opt/simplepackagetest/lib/runtime/lib/libverify.so (0x00007f4e00c2e000) // /lib64/ld-linux-x86-64.so.2 (0x00007f4e00b36000) // libjvm.so => not found // diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxAppBundler.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java similarity index 97% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxAppBundler.java rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java index 1978db0fd6e39..9a308155f78de 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxAppBundler.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; public class LinuxAppBundler extends AppImageBundler { public LinuxAppBundler() { diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxAppImageBuilder.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java similarity index 94% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxAppImageBuilder.java rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java index 0afca510b09da..b5d602afe650c 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxAppImageBuilder.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxAppImageBuilder.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.InputStream; @@ -32,9 +32,9 @@ import java.text.MessageFormat; import java.util.List; import java.util.Map; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ICON; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.ICON; +import static jdk.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; public class LinuxAppImageBuilder extends AbstractAppImageBuilder { diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxDebBundler.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java similarity index 97% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxDebBundler.java rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java index e79de26b4e11a..3732193a20b39 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxDebBundler.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.FileVisitResult; @@ -45,13 +45,13 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.RELEASE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VENDOR; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.LICENSE_FILE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.COPYRIGHT; +import static jdk.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.StandardBundlerParam.RELEASE; +import static jdk.jpackage.internal.StandardBundlerParam.VENDOR; +import static jdk.jpackage.internal.StandardBundlerParam.LICENSE_FILE; +import static jdk.jpackage.internal.StandardBundlerParam.COPYRIGHT; public class LinuxDebBundler extends LinuxPackageBundler { diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxPackageBundler.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxPackageBundler.java similarity index 95% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxPackageBundler.java rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxPackageBundler.java index 622d93dab35c3..e2e0308771713 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxPackageBundler.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxPackageBundler.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.InvalidPathException; @@ -40,13 +40,13 @@ import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; -import static jdk.incubator.jpackage.internal.DesktopIntegration.*; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.PREDEFINED_RUNTIME_IMAGE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.RELEASE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VENDOR; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.DESCRIPTION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.INSTALL_DIR; +import static jdk.jpackage.internal.DesktopIntegration.*; +import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_RUNTIME_IMAGE; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.StandardBundlerParam.RELEASE; +import static jdk.jpackage.internal.StandardBundlerParam.VENDOR; +import static jdk.jpackage.internal.StandardBundlerParam.DESCRIPTION; +import static jdk.jpackage.internal.StandardBundlerParam.INSTALL_DIR; abstract class LinuxPackageBundler extends AbstractBundler { diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxRpmBundler.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java similarity index 96% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxRpmBundler.java rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java index 4ddddf0ae9174..ac33836579e1f 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/LinuxRpmBundler.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxRpmBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Path; @@ -37,12 +37,12 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.LICENSE_FILE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.RELEASE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.TEMP_ROOT; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.LICENSE_FILE; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.StandardBundlerParam.RELEASE; +import static jdk.jpackage.internal.StandardBundlerParam.TEMP_ROOT; +import static jdk.jpackage.internal.OverridableResource.createResource; /** * There are two command line options to configure license information for RPM diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/PackageProperty.java b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/PackageProperty.java similarity index 98% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/PackageProperty.java rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/PackageProperty.java index 8d2f2ffef8846..b9f43b93742aa 100644 --- a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/PackageProperty.java +++ b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/PackageProperty.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.text.MessageFormat; diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources.properties b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources.properties similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources.properties rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources.properties diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_ja.properties b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources_ja.properties similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_ja.properties rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources_ja.properties diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_zh_CN.properties b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources_zh_CN.properties similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/LinuxResources_zh_CN.properties rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/LinuxResources_zh_CN.properties diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/java32.png b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/java32.png similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/java32.png rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/java32.png diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.control b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.control similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.control rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.control diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.copyright b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.copyright similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.copyright rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.copyright diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.desktop b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.desktop similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.desktop rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.desktop diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.postinst b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.postinst similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.postinst rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.postinst diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.postrm b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.postrm similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.postrm rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.postrm diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.preinst b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.preinst similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.preinst rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.preinst diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.prerm b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.prerm similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.prerm rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.prerm diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.spec b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/template.spec rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec diff --git a/src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/utils.sh b/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/utils.sh similarity index 100% rename from src/jdk.incubator.jpackage/linux/classes/jdk/incubator/jpackage/internal/resources/utils.sh rename to src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/utils.sh diff --git a/src/jdk.incubator.jpackage/windows/classes/module-info.java.extra b/src/jdk.jpackage/linux/classes/module-info.java.extra similarity index 85% rename from src/jdk.incubator.jpackage/windows/classes/module-info.java.extra rename to src/jdk.jpackage/linux/classes/module-info.java.extra index 6e34520b6d163..d32314b04299b 100644 --- a/src/jdk.incubator.jpackage/windows/classes/module-info.java.extra +++ b/src/jdk.jpackage/linux/classes/module-info.java.extra @@ -23,8 +23,8 @@ * questions. */ -provides jdk.incubator.jpackage.internal.Bundler with - jdk.incubator.jpackage.internal.WinAppBundler, - jdk.incubator.jpackage.internal.WinExeBundler, - jdk.incubator.jpackage.internal.WinMsiBundler; +provides jdk.jpackage.internal.Bundler with + jdk.jpackage.internal.LinuxAppBundler, + jdk.jpackage.internal.LinuxDebBundler, + jdk.jpackage.internal.LinuxRpmBundler; diff --git a/src/jdk.incubator.jpackage/linux/native/applauncher/Executor.cpp b/src/jdk.jpackage/linux/native/applauncher/Executor.cpp similarity index 100% rename from src/jdk.incubator.jpackage/linux/native/applauncher/Executor.cpp rename to src/jdk.jpackage/linux/native/applauncher/Executor.cpp diff --git a/src/jdk.incubator.jpackage/linux/native/applauncher/Executor.h b/src/jdk.jpackage/linux/native/applauncher/Executor.h similarity index 100% rename from src/jdk.incubator.jpackage/linux/native/applauncher/Executor.h rename to src/jdk.jpackage/linux/native/applauncher/Executor.h diff --git a/src/jdk.incubator.jpackage/linux/native/applauncher/LinuxLauncher.cpp b/src/jdk.jpackage/linux/native/applauncher/LinuxLauncher.cpp similarity index 100% rename from src/jdk.incubator.jpackage/linux/native/applauncher/LinuxLauncher.cpp rename to src/jdk.jpackage/linux/native/applauncher/LinuxLauncher.cpp diff --git a/src/jdk.incubator.jpackage/linux/native/applauncher/Package.cpp b/src/jdk.jpackage/linux/native/applauncher/Package.cpp similarity index 100% rename from src/jdk.incubator.jpackage/linux/native/applauncher/Package.cpp rename to src/jdk.jpackage/linux/native/applauncher/Package.cpp diff --git a/src/jdk.incubator.jpackage/linux/native/applauncher/Package.h b/src/jdk.jpackage/linux/native/applauncher/Package.h similarity index 100% rename from src/jdk.incubator.jpackage/linux/native/applauncher/Package.h rename to src/jdk.jpackage/linux/native/applauncher/Package.h diff --git a/src/jdk.incubator.jpackage/linux/native/common/LinuxSysInfo.cpp b/src/jdk.jpackage/linux/native/common/LinuxSysInfo.cpp similarity index 100% rename from src/jdk.incubator.jpackage/linux/native/common/LinuxSysInfo.cpp rename to src/jdk.jpackage/linux/native/common/LinuxSysInfo.cpp diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/CFBundleVersion.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/CFBundleVersion.java similarity index 98% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/CFBundleVersion.java rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/CFBundleVersion.java index a144f0f29e351..61bedfb8e67ca 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/CFBundleVersion.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/CFBundleVersion.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.math.BigInteger; diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java similarity index 92% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppBundler.java rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java index aba31acbd716a..e7054c4c12237 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppBundler.java @@ -23,17 +23,17 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.text.MessageFormat; import java.util.Map; import java.util.Optional; -import static jdk.incubator.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN; -import static jdk.incubator.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEY_USER; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.MAIN_CLASS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERBOSE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN; +import static jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEY_USER; +import static jdk.jpackage.internal.StandardBundlerParam.MAIN_CLASS; +import static jdk.jpackage.internal.StandardBundlerParam.VERBOSE; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; public class MacAppBundler extends AppImageBundler { public MacAppBundler() { diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java similarity index 95% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java index 3f51bc824ce9d..82ba22ac34418 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppImageBuilder.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppImageBuilder.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.InputStream; @@ -49,28 +49,28 @@ import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; -import static jdk.incubator.jpackage.internal.MacAppBundler.BUNDLE_ID_SIGNING_PREFIX; -import static jdk.incubator.jpackage.internal.MacAppBundler.DEVELOPER_ID_APP_SIGNING_KEY; -import static jdk.incubator.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.COPYRIGHT; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FA_CONTENT_TYPE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FA_DESCRIPTION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FA_EXTENSIONS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FA_ICON; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FILE_ASSOCIATIONS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ICON; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.MAIN_CLASS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; +import static jdk.jpackage.internal.MacAppBundler.BUNDLE_ID_SIGNING_PREFIX; +import static jdk.jpackage.internal.MacAppBundler.DEVELOPER_ID_APP_SIGNING_KEY; +import static jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN; +import static jdk.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; +import static jdk.jpackage.internal.StandardBundlerParam.COPYRIGHT; +import static jdk.jpackage.internal.StandardBundlerParam.FA_CONTENT_TYPE; +import static jdk.jpackage.internal.StandardBundlerParam.FA_DESCRIPTION; +import static jdk.jpackage.internal.StandardBundlerParam.FA_EXTENSIONS; +import static jdk.jpackage.internal.StandardBundlerParam.FA_ICON; +import static jdk.jpackage.internal.StandardBundlerParam.FILE_ASSOCIATIONS; +import static jdk.jpackage.internal.StandardBundlerParam.ICON; +import static jdk.jpackage.internal.StandardBundlerParam.MAIN_CLASS; +import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; public class MacAppImageBuilder extends AbstractAppImageBuilder { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MacResources"); + "jdk.jpackage.internal.resources.MacResources"); private static final String TEMPLATE_BUNDLE_ICON = "java.icns"; private static final String OS_TYPE_CODE = "APPL"; diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppStoreBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java similarity index 94% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppStoreBundler.java rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java index 44e7ecf058197..8dcbdd8b765ab 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacAppStoreBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacAppStoreBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.nio.file.Files; import java.nio.file.Path; @@ -35,16 +35,16 @@ import java.util.Optional; import java.util.ResourceBundle; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERBOSE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.MacAppBundler.DEVELOPER_ID_APP_SIGNING_KEY; -import static jdk.incubator.jpackage.internal.MacAppBundler.DEFAULT_ICNS_ICON; -import static jdk.incubator.jpackage.internal.MacAppBundler.BUNDLE_ID_SIGNING_PREFIX; +import static jdk.jpackage.internal.StandardBundlerParam.VERBOSE; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.MacAppBundler.DEVELOPER_ID_APP_SIGNING_KEY; +import static jdk.jpackage.internal.MacAppBundler.DEFAULT_ICNS_ICON; +import static jdk.jpackage.internal.MacAppBundler.BUNDLE_ID_SIGNING_PREFIX; public class MacAppStoreBundler extends MacBaseInstallerBundler { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MacResources"); + "jdk.jpackage.internal.resources.MacResources"); private static final String TEMPLATE_BUNDLE_ICON_HIDPI = "java.icns"; diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacBaseInstallerBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java similarity index 95% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacBaseInstallerBundler.java rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java index 1d7c999ba2d15..4d38cd3e16724 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacBaseInstallerBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacBaseInstallerBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -36,10 +36,10 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.INSTALL_DIR; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.INSTALL_DIR; +import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; public abstract class MacBaseInstallerBundler extends AbstractBundler { diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacCertificate.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java similarity index 99% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacCertificate.java rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java index b1c0ec78bcade..75dd82c8ff06a 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacCertificate.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacCertificate.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacDmgBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java similarity index 96% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacDmgBundler.java rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java index 2973731010f37..32b5c261097c3 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacDmgBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacDmgBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.BufferedReader; import java.io.File; @@ -37,20 +37,20 @@ import java.util.Map; import java.util.Objects; import java.util.ResourceBundle; -import static jdk.incubator.jpackage.internal.MacAppImageBuilder.ICON_ICNS; -import static jdk.incubator.jpackage.internal.MacAppImageBuilder.MAC_CF_BUNDLE_IDENTIFIER; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.MacAppImageBuilder.ICON_ICNS; +import static jdk.jpackage.internal.MacAppImageBuilder.MAC_CF_BUNDLE_IDENTIFIER; +import static jdk.jpackage.internal.OverridableResource.createResource; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.LICENSE_FILE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.TEMP_ROOT; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERBOSE; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; +import static jdk.jpackage.internal.StandardBundlerParam.LICENSE_FILE; +import static jdk.jpackage.internal.StandardBundlerParam.TEMP_ROOT; +import static jdk.jpackage.internal.StandardBundlerParam.VERBOSE; public class MacDmgBundler extends MacBaseInstallerBundler { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MacResources"); + "jdk.jpackage.internal.resources.MacResources"); // Background image name in resources static final String DEFAULT_BACKGROUND_IMAGE = "background_dmg.tiff"; diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacPkgBundler.java b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java similarity index 96% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacPkgBundler.java rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java index 5b5b8189234ec..27b74a1064128 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/MacPkgBundler.java +++ b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/MacPkgBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.PrintWriter; @@ -40,21 +40,21 @@ import java.util.Optional; import java.util.ResourceBundle; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.TEMP_ROOT; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERBOSE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.LICENSE_FILE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; -import static jdk.incubator.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN; -import static jdk.incubator.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEY_USER; -import static jdk.incubator.jpackage.internal.MacAppImageBuilder.MAC_CF_BUNDLE_IDENTIFIER; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; +import static jdk.jpackage.internal.StandardBundlerParam.TEMP_ROOT; +import static jdk.jpackage.internal.StandardBundlerParam.VERBOSE; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.LICENSE_FILE; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEYCHAIN; +import static jdk.jpackage.internal.MacBaseInstallerBundler.SIGNING_KEY_USER; +import static jdk.jpackage.internal.MacAppImageBuilder.MAC_CF_BUNDLE_IDENTIFIER; +import static jdk.jpackage.internal.OverridableResource.createResource; public class MacPkgBundler extends MacBaseInstallerBundler { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MacResources"); + "jdk.jpackage.internal.resources.MacResources"); private static final String DEFAULT_BACKGROUND_IMAGE = "background_pkg.png"; diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/DMGsetup.scpt b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/DMGsetup.scpt similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/DMGsetup.scpt rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/DMGsetup.scpt diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/Info-lite.plist.template b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/Info-lite.plist.template similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/Info-lite.plist.template rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/Info-lite.plist.template diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources.properties b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources.properties rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources.properties diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_ja.properties b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources_ja.properties similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_ja.properties rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources_ja.properties diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_zh_CN.properties b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources_zh_CN.properties similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/MacResources_zh_CN.properties rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/MacResources_zh_CN.properties diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/Runtime-Info.plist.template b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/Runtime-Info.plist.template similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/Runtime-Info.plist.template rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/Runtime-Info.plist.template diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/background_dmg.tiff b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/background_dmg.tiff similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/background_dmg.tiff rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/background_dmg.tiff diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/background_pkg.png b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/background_pkg.png similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/background_pkg.png rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/background_pkg.png diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/java.icns b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/java.icns similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/java.icns rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/java.icns diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/lic_template.plist b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/lic_template.plist similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/lic_template.plist rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/lic_template.plist diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/postinstall.template b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/postinstall.template similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/postinstall.template rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/postinstall.template diff --git a/src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/preinstall.template b/src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/preinstall.template similarity index 100% rename from src/jdk.incubator.jpackage/macosx/classes/jdk/incubator/jpackage/internal/resources/preinstall.template rename to src/jdk.jpackage/macosx/classes/jdk/jpackage/internal/resources/preinstall.template diff --git a/src/jdk.incubator.jpackage/linux/classes/module-info.java.extra b/src/jdk.jpackage/macosx/classes/module-info.java.extra similarity index 85% rename from src/jdk.incubator.jpackage/linux/classes/module-info.java.extra rename to src/jdk.jpackage/macosx/classes/module-info.java.extra index 0c2987a8bf452..158209e979629 100644 --- a/src/jdk.incubator.jpackage/linux/classes/module-info.java.extra +++ b/src/jdk.jpackage/macosx/classes/module-info.java.extra @@ -23,8 +23,9 @@ * questions. */ -provides jdk.incubator.jpackage.internal.Bundler with - jdk.incubator.jpackage.internal.LinuxAppBundler, - jdk.incubator.jpackage.internal.LinuxDebBundler, - jdk.incubator.jpackage.internal.LinuxRpmBundler; +provides jdk.jpackage.internal.Bundler with + jdk.jpackage.internal.MacAppBundler, + jdk.jpackage.internal.MacAppStoreBundler, + jdk.jpackage.internal.MacDmgBundler, + jdk.jpackage.internal.MacPkgBundler; diff --git a/src/jdk.incubator.jpackage/macosx/native/applauncher/MacLauncher.cpp b/src/jdk.jpackage/macosx/native/applauncher/MacLauncher.cpp similarity index 100% rename from src/jdk.incubator.jpackage/macosx/native/applauncher/MacLauncher.cpp rename to src/jdk.jpackage/macosx/native/applauncher/MacLauncher.cpp diff --git a/src/jdk.incubator.jpackage/macosx/native/common/MacSysInfo.cpp b/src/jdk.jpackage/macosx/native/common/MacSysInfo.cpp similarity index 100% rename from src/jdk.incubator.jpackage/macosx/native/common/MacSysInfo.cpp rename to src/jdk.jpackage/macosx/native/common/MacSysInfo.cpp diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AbstractAppImageBuilder.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java similarity index 91% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AbstractAppImageBuilder.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java index a941c66d72111..da73b9a641914 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AbstractAppImageBuilder.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractAppImageBuilder.java @@ -23,17 +23,17 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.InputStream; import java.nio.file.Path; import java.util.Map; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ICON; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.SOURCE_DIR; -import jdk.incubator.jpackage.internal.resources.ResourceLocator; +import static jdk.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.ICON; +import static jdk.jpackage.internal.StandardBundlerParam.SOURCE_DIR; +import jdk.jpackage.internal.resources.ResourceLocator; /* * AbstractAppImageBuilder diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AbstractBundler.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractBundler.java similarity index 98% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AbstractBundler.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractBundler.java index ef2ed7433ba97..b615176fd15cf 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AbstractBundler.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AbstractBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Path; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AddLauncherArguments.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java similarity index 97% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AddLauncherArguments.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java index ade19cd2c3a15..bf2107f6210cf 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AddLauncherArguments.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AddLauncherArguments.java @@ -23,14 +23,14 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.nio.file.Path; import java.util.HashMap; import java.util.Map; import java.util.List; -import jdk.incubator.jpackage.internal.Arguments.CLIOptions; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA; +import jdk.jpackage.internal.Arguments.CLIOptions; +import static jdk.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA; /* * AddLauncherArguments diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AppImageBundler.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageBundler.java similarity index 93% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AppImageBundler.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageBundler.java index 56c0633bb0738..5ee569c94e4a5 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AppImageBundler.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; @@ -32,10 +32,10 @@ import java.util.Map; import java.util.Objects; import java.util.function.Function; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.PREDEFINED_RUNTIME_IMAGE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE; +import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_RUNTIME_IMAGE; +import static jdk.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; class AppImageBundler extends AbstractBundler { diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AppImageFile.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageFile.java similarity index 97% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AppImageFile.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageFile.java index d51f40fa825fc..a2b4278e47c59 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AppImageFile.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/AppImageFile.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; @@ -43,9 +43,9 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; public class AppImageFile { diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ApplicationLayout.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ApplicationLayout.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ApplicationLayout.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/ApplicationLayout.java index ef2e1eef136ab..c725afed3a1bc 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ApplicationLayout.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ApplicationLayout.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.nio.file.Path; import java.util.Map; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Arguments.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java similarity index 98% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Arguments.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java index 9efcbe8cc8fe1..ae44d28b8f7a8 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Arguments.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.Reader; @@ -57,7 +57,7 @@ */ public class Arguments { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MainResources"); + "jdk.jpackage.internal.resources.MainResources"); private static final String FA_EXTENSIONS = "extension"; private static final String FA_CONTENT_TYPE = "mime-type"; @@ -615,12 +615,12 @@ private void validateArguments() throws PackagerException { } } - private jdk.incubator.jpackage.internal.Bundler getPlatformBundler() { + private jdk.jpackage.internal.Bundler getPlatformBundler() { boolean appImage = deployParams.isTargetAppImage(); String type = deployParams.getTargetFormat(); String bundleType = (appImage ? "IMAGE" : "INSTALLER"); - for (jdk.incubator.jpackage.internal.Bundler bundler : + for (jdk.jpackage.internal.Bundler bundler : Bundlers.createBundlersInstance().getBundlers(bundleType)) { if (type == null) { if (bundler.isDefault() @@ -651,7 +651,7 @@ private void generateBundle(Map params) StandardBundlerParam.TEMP_ROOT.fetchFrom(params); // determine what bundler to run - jdk.incubator.jpackage.internal.Bundler bundler = getPlatformBundler(); + jdk.jpackage.internal.Bundler bundler = getPlatformBundler(); if (bundler == null) { throw new PackagerException("ERR_InvalidInstallerType", diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BasicBundlers.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BasicBundlers.java similarity index 98% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BasicBundlers.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/BasicBundlers.java index f6ad3cbe17a61..7f444fe73371e 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BasicBundlers.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BasicBundlers.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.Arrays; import java.util.Collection; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BundleParams.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java similarity index 95% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BundleParams.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java index de56acc110b79..453d6963be2ce 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BundleParams.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundleParams.java @@ -23,11 +23,11 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.HashMap; import java.util.Map; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; public class BundleParams { diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Bundler.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundler.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Bundler.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundler.java index be702f711ea6d..59916fc3ca194 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Bundler.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.nio.file.Path; import java.util.Map; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BundlerParamInfo.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java similarity index 98% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BundlerParamInfo.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java index 0db8c8cc95bf4..4173980002bb8 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/BundlerParamInfo.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/BundlerParamInfo.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.Map; import java.util.function.BiFunction; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Bundlers.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundlers.java similarity index 98% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Bundlers.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundlers.java index 88150ce4f0e97..955952d563d96 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Bundlers.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Bundlers.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.Collection; import java.util.Iterator; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/CLIHelp.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CLIHelp.java similarity index 97% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/CLIHelp.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/CLIHelp.java index 6f803d549b81f..d9ee8d81bfd29 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/CLIHelp.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CLIHelp.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.ResourceBundle; import java.io.File; @@ -38,7 +38,7 @@ public class CLIHelp { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.HelpResources"); + "jdk.jpackage.internal.resources.HelpResources"); // generates --help for jpackage's CLI public static void showHelp(boolean noArgs) { diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/CfgFile.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CfgFile.java similarity index 92% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/CfgFile.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/CfgFile.java index 99d3f77bbfa75..0826e3970a4c7 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/CfgFile.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/CfgFile.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.File; @@ -32,11 +32,11 @@ import java.util.List; import java.util.Map; import java.util.stream.Stream; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.JAVA_OPTIONS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ARGUMENTS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.JAVA_OPTIONS; +import static jdk.jpackage.internal.StandardBundlerParam.ARGUMENTS; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; /** * App launcher's config file. diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ConfigException.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ConfigException.java similarity index 97% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ConfigException.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/ConfigException.java index 8dba7bd383cc6..5a43fbe93fee4 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ConfigException.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ConfigException.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; public class ConfigException extends Exception { private static final long serialVersionUID = 1L; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DeployParams.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DeployParams.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java index 2c54a089ce549..0783c327e115d 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DeployParams.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.File; import java.io.IOException; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DottedVersion.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DottedVersion.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java index 8ade9a28ace51..652c90ae1e640 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/DottedVersion.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DottedVersion.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.math.BigInteger; import java.text.MessageFormat; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Executor.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Executor.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java index 0ada00dec68d4..320a63190b596 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Executor.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.BufferedReader; import java.io.IOException; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/FileAssociation.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/FileAssociation.java similarity index 88% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/FileAssociation.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/FileAssociation.java index b4b9be9f15041..7f8ff7fa16841 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/FileAssociation.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/FileAssociation.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.nio.file.Path; import java.text.MessageFormat; @@ -33,12 +33,12 @@ import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FILE_ASSOCIATIONS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FA_EXTENSIONS; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FA_CONTENT_TYPE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FA_ICON; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.FA_DESCRIPTION; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.FILE_ASSOCIATIONS; +import static jdk.jpackage.internal.StandardBundlerParam.FA_EXTENSIONS; +import static jdk.jpackage.internal.StandardBundlerParam.FA_CONTENT_TYPE; +import static jdk.jpackage.internal.StandardBundlerParam.FA_ICON; +import static jdk.jpackage.internal.StandardBundlerParam.FA_DESCRIPTION; final class FileAssociation { void verify() { diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/I18N.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/I18N.java similarity index 84% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/I18N.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/I18N.java index dac2e930c8595..f349b71126e99 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/I18N.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/I18N.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.ResourceBundle; @@ -36,20 +36,20 @@ static String getString(String key) { } private static final ResourceBundle SHARED = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MainResources"); + "jdk.jpackage.internal.resources.MainResources"); private static final ResourceBundle PLATFORM; static { if (Platform.isLinux()) { PLATFORM = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.LinuxResources"); + "jdk.jpackage.internal.resources.LinuxResources"); } else if (Platform.isWindows()) { PLATFORM = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.WinResources"); + "jdk.jpackage.internal.resources.WinResources"); } else if (Platform.isMac()) { PLATFORM = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MacResources"); + "jdk.jpackage.internal.resources.MacResources"); } else { throw new IllegalStateException("Unknwon platform"); } diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/IOUtils.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/IOUtils.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java index 27ae1f175b903..414ae2275ee8a 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/IOUtils.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/IOUtils.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.BufferedReader; import java.io.InputStreamReader; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JLinkBundlerHelper.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JLinkBundlerHelper.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java index cbd9eda8d4399..343c469f93160 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JLinkBundlerHelper.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JLinkBundlerHelper.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.File; import java.io.IOException; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JPackageToolProvider.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JPackageToolProvider.java similarity index 93% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JPackageToolProvider.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/JPackageToolProvider.java index e4d18a4656f9d..18f7f5df21a9c 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/JPackageToolProvider.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/JPackageToolProvider.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.PrintWriter; import java.util.spi.ToolProvider; @@ -43,7 +43,7 @@ public String name() { public synchronized int run( PrintWriter out, PrintWriter err, String... args) { try { - return new jdk.incubator.jpackage.main.Main().execute(out, err, args); + return new jdk.jpackage.main.Main().execute(out, err, args); } catch (RuntimeException re) { Log.fatalError(re.getMessage()); Log.verbose(re); diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/LauncherData.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/LauncherData.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java index ef9d36854f3eb..2541ffdc20a34 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/LauncherData.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.File; import java.io.IOException; @@ -46,7 +46,7 @@ import java.util.jar.Manifest; import java.util.stream.Collectors; import java.util.stream.Stream; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.PREDEFINED_RUNTIME_IMAGE; +import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_RUNTIME_IMAGE; /** * Extracts data needed to run application from parameters. diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Log.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Log.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Log.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/Log.java index e1e6b1bff05c2..c20066075d233 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Log.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Log.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.PrintWriter; import java.text.SimpleDateFormat; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/OverridableResource.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OverridableResource.java similarity index 97% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/OverridableResource.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/OverridableResource.java index c29a8b638408c..23ed0ee74770e 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/OverridableResource.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/OverridableResource.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.BufferedReader; import java.io.ByteArrayInputStream; @@ -42,8 +42,8 @@ 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; +import static jdk.jpackage.internal.StandardBundlerParam.RESOURCE_DIR; +import jdk.jpackage.internal.resources.ResourceLocator; /** @@ -52,7 +52,7 @@ * jpackage parameter. * * Resource has default name and public name. Default name is the name of a file - * in {@code jdk.incubator.jpackage.internal.resources} package that provides the default + * in {@code jdk.jpackage.internal.resources} package that provides the default * value of the resource. * * Public name is a path relative to resource directory to a file with custom diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PackagerException.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PackagerException.java similarity index 94% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PackagerException.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/PackagerException.java index e5414b2318823..b5f514ae1ab68 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PackagerException.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PackagerException.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.text.MessageFormat; import java.util.ResourceBundle; @@ -31,7 +31,7 @@ public class PackagerException extends Exception { private static final long serialVersionUID = 1L; private static final ResourceBundle bundle = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MainResources"); + "jdk.jpackage.internal.resources.MainResources"); public PackagerException(Throwable cause) { super(cause); diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PathGroup.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PathGroup.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PathGroup.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/PathGroup.java index d7e332f3fbfcf..2cb44db59f92c 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PathGroup.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PathGroup.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Platform.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Platform.java similarity index 98% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Platform.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/Platform.java index 7b03b36fe4dcf..5849c1777ac00 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/Platform.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Platform.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.regex.Pattern; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PlatformPackage.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PlatformPackage.java similarity index 97% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PlatformPackage.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/PlatformPackage.java index 54aa2333df459..6102e24c015f5 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/PlatformPackage.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/PlatformPackage.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.nio.file.Path; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/RetryExecutor.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RetryExecutor.java similarity index 98% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/RetryExecutor.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/RetryExecutor.java index 2370389d52b29..dfa75b217afce 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/RetryExecutor.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/RetryExecutor.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.util.function.Consumer; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ScriptRunner.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ScriptRunner.java similarity index 92% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ScriptRunner.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/ScriptRunner.java index 9d6f037b4009d..47fe75da4bc9e 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ScriptRunner.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ScriptRunner.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; @@ -31,9 +31,9 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; +import static jdk.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; /** * Runs custom script from resource directory. diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/StandardBundlerParam.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/StandardBundlerParam.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java index 173e5183f9487..ec8ede14dc42a 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/StandardBundlerParam.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.File; import java.io.IOException; @@ -235,7 +235,7 @@ class StandardBundlerParam extends BundlerParamInfo { Path.class, params -> { try { - return Files.createTempDirectory("jdk.incubator.jpackage"); + return Files.createTempDirectory("jdk.jpackage"); } catch (IOException ioe) { return null; } diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ToolValidator.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ToolValidator.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ToolValidator.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/ToolValidator.java index 497d46e19bea3..04519ca710ae6 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ToolValidator.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ToolValidator.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Path; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ValidOptions.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java similarity index 98% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ValidOptions.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java index de56d44847354..5fb8a68fbe295 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/ValidOptions.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/ValidOptions.java @@ -23,10 +23,10 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.HashMap; -import jdk.incubator.jpackage.internal.Arguments.CLIOptions; +import jdk.jpackage.internal.Arguments.CLIOptions; /** * ValidOptions diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties similarity index 100% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources.properties rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_ja.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties similarity index 100% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_ja.properties rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_zh_CN.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties similarity index 100% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/HelpResources_zh_CN.properties rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties similarity index 100% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources.properties rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources.properties diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties similarity index 100% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_ja.properties rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_ja.properties diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties similarity index 100% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/MainResources_zh_CN.properties rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/MainResources_zh_CN.properties diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/ResourceLocator.java b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java similarity index 96% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/ResourceLocator.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java index c51d1daf425ec..dfb5da7f82973 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/resources/ResourceLocator.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/ResourceLocator.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal.resources; +package jdk.jpackage.internal.resources; /* * ResourceLocator diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/main/CommandLine.java b/src/jdk.jpackage/share/classes/jdk/jpackage/main/CommandLine.java similarity index 99% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/main/CommandLine.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/main/CommandLine.java index 08ebc23f8faf3..e9ab994624b36 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/main/CommandLine.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/main/CommandLine.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.main; +package jdk.jpackage.main; import java.io.FileNotFoundException; import java.io.IOException; diff --git a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/main/Main.java b/src/jdk.jpackage/share/classes/jdk/jpackage/main/Main.java similarity index 92% rename from src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/main/Main.java rename to src/jdk.jpackage/share/classes/jdk/jpackage/main/Main.java index 7cf25e872c63c..1381902f52ac2 100644 --- a/src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/main/Main.java +++ b/src/jdk.jpackage/share/classes/jdk/jpackage/main/Main.java @@ -23,11 +23,11 @@ * questions. */ -package jdk.incubator.jpackage.main; +package jdk.jpackage.main; -import jdk.incubator.jpackage.internal.Arguments; -import jdk.incubator.jpackage.internal.Log; -import jdk.incubator.jpackage.internal.CLIHelp; +import jdk.jpackage.internal.Arguments; +import jdk.jpackage.internal.Log; +import jdk.jpackage.internal.CLIHelp; import java.io.PrintWriter; import java.util.ResourceBundle; import java.io.FileNotFoundException; @@ -37,7 +37,7 @@ public class Main { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.MainResources"); + "jdk.jpackage.internal.resources.MainResources"); /** * main(String... args) @@ -49,7 +49,7 @@ public static void main(String... args) throws Exception { // Create logger with default system.out and system.err Log.setLogger(null); - int status = new jdk.incubator.jpackage.main.Main().execute(args); + int status = new jdk.jpackage.main.Main().execute(args); System.exit(status); } diff --git a/src/jdk.incubator.jpackage/share/classes/module-info.java b/src/jdk.jpackage/share/classes/module-info.java similarity index 86% rename from src/jdk.incubator.jpackage/share/classes/module-info.java rename to src/jdk.jpackage/share/classes/module-info.java index 1b516403a71e3..475daa0bd56f2 100644 --- a/src/jdk.incubator.jpackage/share/classes/module-info.java +++ b/src/jdk.jpackage/share/classes/module-info.java @@ -43,20 +43,20 @@ * * * @moduleGraph - * @since 14 + * @since 16 */ -module jdk.incubator.jpackage { +module jdk.jpackage { requires jdk.jlink; requires java.desktop; - uses jdk.incubator.jpackage.internal.Bundler; - uses jdk.incubator.jpackage.internal.Bundlers; + uses jdk.jpackage.internal.Bundler; + uses jdk.jpackage.internal.Bundlers; - provides jdk.incubator.jpackage.internal.Bundlers with - jdk.incubator.jpackage.internal.BasicBundlers; + provides jdk.jpackage.internal.Bundlers with + jdk.jpackage.internal.BasicBundlers; provides java.util.spi.ToolProvider - with jdk.incubator.jpackage.internal.JPackageToolProvider; + with jdk.jpackage.internal.JPackageToolProvider; } diff --git a/src/jdk.incubator.jpackage/share/man/jpackage.1 b/src/jdk.jpackage/share/man/jpackage.1 similarity index 96% rename from src/jdk.incubator.jpackage/share/man/jpackage.1 rename to src/jdk.jpackage/share/man/jpackage.1 index 2311b23385394..8fa4a24005b68 100644 --- a/src/jdk.incubator.jpackage/share/man/jpackage.1 +++ b/src/jdk.jpackage/share/man/jpackage.1 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. +.\" Copyright (c) 2018, 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 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JPACKAGE" "1" "2019" "JDK 15" "JDK Commands" +.TH "JPACKAGE" "1" "2019" "JDK 16" "JDK Commands" .hy .SH NAME .PP @@ -152,10 +152,14 @@ and is absolute or relative to the current directory. This option can be used multiple times. .RE .TP -.B \f[CB]\-\-bind\-services\f[R] -Pass on \-\-bind\-services option to jlink (which will link in service -provider modules and their dependences). +.B \f[CB]\-\-jlink\-options\f[R] +A space separated list of options to pass to jlink .RS +.PP +If not specified, defaults to "\-\-strip\-native\-commands +\-\-strip\-debug \-\-no\-man\-pages \-\-no\-header\-files" +.PP +This option can be used multiple times. .RE .TP .B \f[CB]\-\-runtime\-image\f[R] diff --git a/src/jdk.incubator.jpackage/share/native/applauncher/AppLauncher.cpp b/src/jdk.jpackage/share/native/applauncher/AppLauncher.cpp similarity index 100% rename from src/jdk.incubator.jpackage/share/native/applauncher/AppLauncher.cpp rename to src/jdk.jpackage/share/native/applauncher/AppLauncher.cpp diff --git a/src/jdk.incubator.jpackage/share/native/applauncher/AppLauncher.h b/src/jdk.jpackage/share/native/applauncher/AppLauncher.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/applauncher/AppLauncher.h rename to src/jdk.jpackage/share/native/applauncher/AppLauncher.h diff --git a/src/jdk.incubator.jpackage/share/native/applauncher/CfgFile.cpp b/src/jdk.jpackage/share/native/applauncher/CfgFile.cpp similarity index 100% rename from src/jdk.incubator.jpackage/share/native/applauncher/CfgFile.cpp rename to src/jdk.jpackage/share/native/applauncher/CfgFile.cpp diff --git a/src/jdk.incubator.jpackage/share/native/applauncher/CfgFile.h b/src/jdk.jpackage/share/native/applauncher/CfgFile.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/applauncher/CfgFile.h rename to src/jdk.jpackage/share/native/applauncher/CfgFile.h diff --git a/src/jdk.incubator.jpackage/share/native/applauncher/JvmLauncher.cpp b/src/jdk.jpackage/share/native/applauncher/JvmLauncher.cpp similarity index 100% rename from src/jdk.incubator.jpackage/share/native/applauncher/JvmLauncher.cpp rename to src/jdk.jpackage/share/native/applauncher/JvmLauncher.cpp diff --git a/src/jdk.incubator.jpackage/share/native/applauncher/JvmLauncher.h b/src/jdk.jpackage/share/native/applauncher/JvmLauncher.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/applauncher/JvmLauncher.h rename to src/jdk.jpackage/share/native/applauncher/JvmLauncher.h diff --git a/src/jdk.incubator.jpackage/share/native/common/Dll.h b/src/jdk.jpackage/share/native/common/Dll.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/Dll.h rename to src/jdk.jpackage/share/native/common/Dll.h diff --git a/src/jdk.incubator.jpackage/share/native/common/ErrorHandling.cpp b/src/jdk.jpackage/share/native/common/ErrorHandling.cpp similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/ErrorHandling.cpp rename to src/jdk.jpackage/share/native/common/ErrorHandling.cpp diff --git a/src/jdk.incubator.jpackage/share/native/common/ErrorHandling.h b/src/jdk.jpackage/share/native/common/ErrorHandling.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/ErrorHandling.h rename to src/jdk.jpackage/share/native/common/ErrorHandling.h diff --git a/src/jdk.incubator.jpackage/share/native/common/FileUtils.cpp b/src/jdk.jpackage/share/native/common/FileUtils.cpp similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/FileUtils.cpp rename to src/jdk.jpackage/share/native/common/FileUtils.cpp diff --git a/src/jdk.incubator.jpackage/share/native/common/FileUtils.h b/src/jdk.jpackage/share/native/common/FileUtils.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/FileUtils.h rename to src/jdk.jpackage/share/native/common/FileUtils.h diff --git a/src/jdk.incubator.jpackage/share/native/common/Log.cpp b/src/jdk.jpackage/share/native/common/Log.cpp similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/Log.cpp rename to src/jdk.jpackage/share/native/common/Log.cpp diff --git a/src/jdk.incubator.jpackage/share/native/common/Log.h b/src/jdk.jpackage/share/native/common/Log.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/Log.h rename to src/jdk.jpackage/share/native/common/Log.h diff --git a/src/jdk.incubator.jpackage/share/native/common/SourceCodePos.h b/src/jdk.jpackage/share/native/common/SourceCodePos.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/SourceCodePos.h rename to src/jdk.jpackage/share/native/common/SourceCodePos.h diff --git a/src/jdk.incubator.jpackage/share/native/common/SysInfo.h b/src/jdk.jpackage/share/native/common/SysInfo.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/SysInfo.h rename to src/jdk.jpackage/share/native/common/SysInfo.h diff --git a/src/jdk.incubator.jpackage/share/native/common/Toolbox.h b/src/jdk.jpackage/share/native/common/Toolbox.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/Toolbox.h rename to src/jdk.jpackage/share/native/common/Toolbox.h diff --git a/src/jdk.incubator.jpackage/share/native/common/kludge_c++11.h b/src/jdk.jpackage/share/native/common/kludge_c++11.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/kludge_c++11.h rename to src/jdk.jpackage/share/native/common/kludge_c++11.h diff --git a/src/jdk.incubator.jpackage/share/native/common/tstrings.cpp b/src/jdk.jpackage/share/native/common/tstrings.cpp similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/tstrings.cpp rename to src/jdk.jpackage/share/native/common/tstrings.cpp diff --git a/src/jdk.incubator.jpackage/share/native/common/tstrings.h b/src/jdk.jpackage/share/native/common/tstrings.h similarity index 100% rename from src/jdk.incubator.jpackage/share/native/common/tstrings.h rename to src/jdk.jpackage/share/native/common/tstrings.h diff --git a/src/jdk.incubator.jpackage/unix/native/common/PlatformLogEvent.cpp b/src/jdk.jpackage/unix/native/common/PlatformLogEvent.cpp similarity index 100% rename from src/jdk.incubator.jpackage/unix/native/common/PlatformLogEvent.cpp rename to src/jdk.jpackage/unix/native/common/PlatformLogEvent.cpp diff --git a/src/jdk.incubator.jpackage/unix/native/common/PlatformLogEvent.h b/src/jdk.jpackage/unix/native/common/PlatformLogEvent.h similarity index 100% rename from src/jdk.incubator.jpackage/unix/native/common/PlatformLogEvent.h rename to src/jdk.jpackage/unix/native/common/PlatformLogEvent.h diff --git a/src/jdk.incubator.jpackage/unix/native/common/UnixDll.cpp b/src/jdk.jpackage/unix/native/common/UnixDll.cpp similarity index 100% rename from src/jdk.incubator.jpackage/unix/native/common/UnixDll.cpp rename to src/jdk.jpackage/unix/native/common/UnixDll.cpp diff --git a/src/jdk.incubator.jpackage/unix/native/common/UnixFileUtils.cpp b/src/jdk.jpackage/unix/native/common/UnixFileUtils.cpp similarity index 100% rename from src/jdk.incubator.jpackage/unix/native/common/UnixFileUtils.cpp rename to src/jdk.jpackage/unix/native/common/UnixFileUtils.cpp diff --git a/src/jdk.incubator.jpackage/unix/native/common/UnixSysInfo.cpp b/src/jdk.jpackage/unix/native/common/UnixSysInfo.cpp similarity index 100% rename from src/jdk.incubator.jpackage/unix/native/common/UnixSysInfo.cpp rename to src/jdk.jpackage/unix/native/common/UnixSysInfo.cpp diff --git a/src/jdk.incubator.jpackage/unix/native/common/UnixSysInfo.h b/src/jdk.jpackage/unix/native/common/UnixSysInfo.h similarity index 100% rename from src/jdk.incubator.jpackage/unix/native/common/UnixSysInfo.h rename to src/jdk.jpackage/unix/native/common/UnixSysInfo.h diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/ExecutableRebrander.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/ExecutableRebrander.java similarity index 92% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/ExecutableRebrander.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/ExecutableRebrander.java index 53af7209d4dd8..cec106cdd2404 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/ExecutableRebrander.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/ExecutableRebrander.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -38,18 +38,18 @@ import java.util.Map; 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.TEMP_ROOT; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VENDOR; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.COPYRIGHT; +import static jdk.jpackage.internal.StandardBundlerParam.DESCRIPTION; +import static jdk.jpackage.internal.StandardBundlerParam.TEMP_ROOT; +import static jdk.jpackage.internal.StandardBundlerParam.VENDOR; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; final class ExecutableRebrander { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.WinResources"); + "jdk.jpackage.internal.resources.WinResources"); private static final String LAUNCHER_PROPERTIES_TEMPLATE = "WinLauncher.template"; diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/MsiVersion.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/MsiVersion.java similarity index 98% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/MsiVersion.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/MsiVersion.java index 6d8bba3aa304d..90a56f38066ef 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/MsiVersion.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/MsiVersion.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.math.BigInteger; diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinAppBundler.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java similarity index 97% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinAppBundler.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java index 58a9dddceb696..16ae11e1f4a4e 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinAppBundler.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinAppBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; public class WinAppBundler extends AppImageBundler { public WinAppBundler() { diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinExeBundler.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java similarity index 99% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinExeBundler.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java index b72cf6d11641f..96971193957d4 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinExeBundler.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinExeBundler.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.InputStream; diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinMsiBundler.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java similarity index 96% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinMsiBundler.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java index b01455e5acb3d..8ff2df9998c58 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WinMsiBundler.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WinMsiBundler.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.InputStream; @@ -54,15 +54,15 @@ import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; -import static jdk.incubator.jpackage.internal.OverridableResource.createResource; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.DESCRIPTION; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.LICENSE_FILE; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.RESOURCE_DIR; -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; +import static jdk.jpackage.internal.OverridableResource.createResource; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.CONFIG_ROOT; +import static jdk.jpackage.internal.StandardBundlerParam.DESCRIPTION; +import static jdk.jpackage.internal.StandardBundlerParam.LICENSE_FILE; +import static jdk.jpackage.internal.StandardBundlerParam.RESOURCE_DIR; +import static jdk.jpackage.internal.StandardBundlerParam.TEMP_ROOT; +import static jdk.jpackage.internal.StandardBundlerParam.VENDOR; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; import org.w3c.dom.Document; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; @@ -84,7 +84,7 @@ *
          *

          * main.wxs file is a copy of main.wxs resource from - * jdk.incubator.jpackage.internal.resources package. It is parametrized with the + * jdk.jpackage.internal.resources package. It is parametrized with the * following WiX variables: *

            *
          • JpAppName. Name of the application. Set to the value of --name command diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsAppImageBuilder.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java similarity index 93% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsAppImageBuilder.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java index cb34707d345fb..79db04d5b5b85 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsAppImageBuilder.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.InputStream; @@ -34,13 +34,13 @@ import java.util.Map; import java.util.ResourceBundle; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ICON; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.ICON; +import static jdk.jpackage.internal.StandardBundlerParam.ADD_LAUNCHERS; public class WindowsAppImageBuilder extends AbstractAppImageBuilder { private static final ResourceBundle I18N = ResourceBundle.getBundle( - "jdk.incubator.jpackage.internal.resources.WinResources"); + "jdk.jpackage.internal.resources.WinResources"); private static final String TEMPLATE_APP_ICON ="java48.ico"; diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsDefender.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsDefender.java similarity index 98% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsDefender.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsDefender.java index 8cc8ad45d779f..9dc0e710b29c9 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsDefender.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsDefender.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.List; diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsRegistry.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java similarity index 99% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsRegistry.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java index f502dc03a2f94..a62d9c3b68775 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WindowsRegistry.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsRegistry.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.ArrayList; import java.util.List; diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixPipeline.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixPipeline.java similarity index 99% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixPipeline.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixPipeline.java index 1cc88c63efb26..eebfe052505cd 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixPipeline.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixPipeline.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixSourcesBuilder.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixSourcesBuilder.java similarity index 98% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixSourcesBuilder.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixSourcesBuilder.java index 2193ef7405453..e478cfa9c382f 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixSourcesBuilder.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixSourcesBuilder.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -48,12 +48,12 @@ import java.util.stream.Stream; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import jdk.incubator.jpackage.internal.IOUtils.XmlConsumer; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.APP_NAME; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.INSTALL_DIR; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VENDOR; -import static jdk.incubator.jpackage.internal.StandardBundlerParam.VERSION; -import static jdk.incubator.jpackage.internal.WinMsiBundler.MSI_SYSTEM_WIDE; +import jdk.jpackage.internal.IOUtils.XmlConsumer; +import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME; +import static jdk.jpackage.internal.StandardBundlerParam.INSTALL_DIR; +import static jdk.jpackage.internal.StandardBundlerParam.VENDOR; +import static jdk.jpackage.internal.StandardBundlerParam.VERSION; +import static jdk.jpackage.internal.WinMsiBundler.MSI_SYSTEM_WIDE; /** * Creates application WiX source files. diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixTool.java b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixTool.java similarity index 99% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixTool.java rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixTool.java index cebe3936f8b75..47edbd16c99c0 100644 --- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/WixTool.java +++ b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WixTool.java @@ -23,7 +23,7 @@ * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.FileSystems; diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_en.wxl b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/MsiInstallerStrings_en.wxl similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_en.wxl rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/MsiInstallerStrings_en.wxl diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_ja.wxl b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/MsiInstallerStrings_ja.wxl similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_ja.wxl rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/MsiInstallerStrings_ja.wxl diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_zh_CN.wxl b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/MsiInstallerStrings_zh_CN.wxl similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/MsiInstallerStrings_zh_CN.wxl rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/MsiInstallerStrings_zh_CN.wxl diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinInstaller.template b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinInstaller.template similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinInstaller.template rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinInstaller.template diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinLauncher.template similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinLauncher.template diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources.properties similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources.properties rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources.properties diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_ja.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_ja.properties similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_ja.properties rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_ja.properties diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_zh_CN.properties b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_zh_CN.properties similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinResources_zh_CN.properties rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/WinResources_zh_CN.properties diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/java48.ico b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/java48.ico similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/java48.ico rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/java48.ico diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/main.wxs b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/main.wxs similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/main.wxs rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/main.wxs diff --git a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/overrides.wxi b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/overrides.wxi similarity index 100% rename from src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/overrides.wxi rename to src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/overrides.wxi diff --git a/src/jdk.incubator.jpackage/macosx/classes/module-info.java.extra b/src/jdk.jpackage/windows/classes/module-info.java.extra similarity index 82% rename from src/jdk.incubator.jpackage/macosx/classes/module-info.java.extra rename to src/jdk.jpackage/windows/classes/module-info.java.extra index ea6da5da5a4d6..d9d3bde1e4dee 100644 --- a/src/jdk.incubator.jpackage/macosx/classes/module-info.java.extra +++ b/src/jdk.jpackage/windows/classes/module-info.java.extra @@ -23,9 +23,8 @@ * questions. */ -provides jdk.incubator.jpackage.internal.Bundler with - jdk.incubator.jpackage.internal.MacAppBundler, - jdk.incubator.jpackage.internal.MacAppStoreBundler, - jdk.incubator.jpackage.internal.MacDmgBundler, - jdk.incubator.jpackage.internal.MacPkgBundler; +provides jdk.jpackage.internal.Bundler with + jdk.jpackage.internal.WinAppBundler, + jdk.jpackage.internal.WinExeBundler, + jdk.jpackage.internal.WinMsiBundler; diff --git a/src/jdk.incubator.jpackage/windows/native/applauncher/WinLauncher.cpp b/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/applauncher/WinLauncher.cpp rename to src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/common/PlatformLogEvent.cpp b/src/jdk.jpackage/windows/native/common/PlatformLogEvent.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/PlatformLogEvent.cpp rename to src/jdk.jpackage/windows/native/common/PlatformLogEvent.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/common/PlatformLogEvent.h b/src/jdk.jpackage/windows/native/common/PlatformLogEvent.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/PlatformLogEvent.h rename to src/jdk.jpackage/windows/native/common/PlatformLogEvent.h diff --git a/src/jdk.incubator.jpackage/windows/native/common/UniqueHandle.h b/src/jdk.jpackage/windows/native/common/UniqueHandle.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/UniqueHandle.h rename to src/jdk.jpackage/windows/native/common/UniqueHandle.h diff --git a/src/jdk.incubator.jpackage/windows/native/common/WinDll.cpp b/src/jdk.jpackage/windows/native/common/WinDll.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/WinDll.cpp rename to src/jdk.jpackage/windows/native/common/WinDll.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/common/WinErrorHandling.cpp b/src/jdk.jpackage/windows/native/common/WinErrorHandling.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/WinErrorHandling.cpp rename to src/jdk.jpackage/windows/native/common/WinErrorHandling.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/common/WinErrorHandling.h b/src/jdk.jpackage/windows/native/common/WinErrorHandling.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/WinErrorHandling.h rename to src/jdk.jpackage/windows/native/common/WinErrorHandling.h diff --git a/src/jdk.incubator.jpackage/windows/native/common/WinFileUtils.cpp b/src/jdk.jpackage/windows/native/common/WinFileUtils.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/WinFileUtils.cpp rename to src/jdk.jpackage/windows/native/common/WinFileUtils.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/common/WinFileUtils.h b/src/jdk.jpackage/windows/native/common/WinFileUtils.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/WinFileUtils.h rename to src/jdk.jpackage/windows/native/common/WinFileUtils.h diff --git a/src/jdk.incubator.jpackage/windows/native/common/WinSysInfo.cpp b/src/jdk.jpackage/windows/native/common/WinSysInfo.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/WinSysInfo.cpp rename to src/jdk.jpackage/windows/native/common/WinSysInfo.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/common/WinSysInfo.h b/src/jdk.jpackage/windows/native/common/WinSysInfo.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/common/WinSysInfo.h rename to src/jdk.jpackage/windows/native/common/WinSysInfo.h diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.cpp b/src/jdk.jpackage/windows/native/libjpackage/IconSwap.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.cpp rename to src/jdk.jpackage/windows/native/libjpackage/IconSwap.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.h b/src/jdk.jpackage/windows/native/libjpackage/IconSwap.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/IconSwap.h rename to src/jdk.jpackage/windows/native/libjpackage/IconSwap.h diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.cpp b/src/jdk.jpackage/windows/native/libjpackage/JniUtils.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.cpp rename to src/jdk.jpackage/windows/native/libjpackage/JniUtils.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.h b/src/jdk.jpackage/windows/native/libjpackage/JniUtils.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/JniUtils.h rename to src/jdk.jpackage/windows/native/libjpackage/JniUtils.h diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.cpp b/src/jdk.jpackage/windows/native/libjpackage/ResourceEditor.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.cpp rename to src/jdk.jpackage/windows/native/libjpackage/ResourceEditor.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.h b/src/jdk.jpackage/windows/native/libjpackage/ResourceEditor.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/ResourceEditor.h rename to src/jdk.jpackage/windows/native/libjpackage/ResourceEditor.h diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.cpp b/src/jdk.jpackage/windows/native/libjpackage/VersionInfo.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.cpp rename to src/jdk.jpackage/windows/native/libjpackage/VersionInfo.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.h b/src/jdk.jpackage/windows/native/libjpackage/VersionInfo.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/VersionInfo.h rename to src/jdk.jpackage/windows/native/libjpackage/VersionInfo.h diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp b/src/jdk.jpackage/windows/native/libjpackage/WindowsRegistry.cpp similarity index 84% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp rename to src/jdk.jpackage/windows/native/libjpackage/WindowsRegistry.cpp index 80ba6ce09646d..3ecefb1adca80 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/WindowsRegistry.cpp +++ b/src/jdk.jpackage/windows/native/libjpackage/WindowsRegistry.cpp @@ -71,23 +71,23 @@ std::wstring GetLongPath(const std::wstring& path) { #ifdef __cplusplus extern "C" { #endif -#undef jdk_incubator_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE -#define jdk_incubator_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE 1L +#undef jdk_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE +#define jdk_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE 1L /* - * Class: jdk_incubator_jpackage_internal_WindowsRegistry + * Class: jdk_jpackage_internal_WindowsRegistry * Method: readDwordValue * Signature: (ILjava/lang/String;Ljava/lang/String;I)I */ JNIEXPORT jint JNICALL - Java_jdk_incubator_jpackage_internal_WindowsRegistry_readDwordValue( + Java_jdk_jpackage_internal_WindowsRegistry_readDwordValue( JNIEnv *pEnv, jclass c, jint key, jstring jSubKey, jstring jValue, jint defaultValue) { jint jResult = defaultValue; JP_TRY; - if (key != jdk_incubator_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE) { + if (key != jdk_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE) { JP_THROW("Inavlid Windows registry key id"); } @@ -115,17 +115,17 @@ extern "C" { } /* - * Class: jdk_incubator_jpackage_internal_WindowsRegistry + * Class: jdk_jpackage_internal_WindowsRegistry * Method: openRegistryKey * Signature: (ILjava/lang/String;)J */ JNIEXPORT jlong JNICALL - Java_jdk_incubator_jpackage_internal_WindowsRegistry_openRegistryKey( + Java_jdk_jpackage_internal_WindowsRegistry_openRegistryKey( JNIEnv *pEnv, jclass c, jint key, jstring jSubKey) { JP_TRY; - if (key != jdk_incubator_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE) { + if (key != jdk_jpackage_internal_WindowsRegistry_HKEY_LOCAL_MACHINE) { JP_THROW("Inavlid Windows registry key id"); } @@ -143,12 +143,12 @@ extern "C" { } /* - * Class: jdk_incubator_jpackage_internal_WindowsRegistry + * Class: jdk_jpackage_internal_WindowsRegistry * Method: enumRegistryValue * Signature: (JI)Ljava/lang/String; */ JNIEXPORT jstring JNICALL - Java_jdk_incubator_jpackage_internal_WindowsRegistry_enumRegistryValue( + Java_jdk_jpackage_internal_WindowsRegistry_enumRegistryValue( JNIEnv *pEnv, jclass c, jlong lKey, jint jIndex) { JP_TRY; @@ -175,24 +175,24 @@ extern "C" { } /* - * Class: jdk_incubator_jpackage_internal_WindowsRegistry + * Class: jdk_jpackage_internal_WindowsRegistry * Method: closeRegistryKey * Signature: (J)V */ JNIEXPORT void JNICALL - Java_jdk_incubator_jpackage_internal_WindowsRegistry_closeRegistryKey( + Java_jdk_jpackage_internal_WindowsRegistry_closeRegistryKey( JNIEnv *pEnc, jclass c, jlong lKey) { HKEY hKey = (HKEY)lKey; RegCloseKey(hKey); } /* - * Class: jdk_incubator_jpackage_internal_WindowsRegistry + * Class: jdk_jpackage_internal_WindowsRegistry * Method: comparePaths * Signature: (Ljava/lang/String;Ljava/lang/String;)Z */ JNIEXPORT jboolean JNICALL - Java_jdk_incubator_jpackage_internal_WindowsRegistry_comparePaths( + Java_jdk_jpackage_internal_WindowsRegistry_comparePaths( JNIEnv *pEnv, jclass c, jstring jPath1, jstring jPath2) { JP_TRY; diff --git a/src/jdk.incubator.jpackage/windows/native/libjpackage/jpackage.cpp b/src/jdk.jpackage/windows/native/libjpackage/jpackage.cpp similarity index 84% rename from src/jdk.incubator.jpackage/windows/native/libjpackage/jpackage.cpp rename to src/jdk.jpackage/windows/native/libjpackage/jpackage.cpp index 4e1a574d96316..66e20b18aefa6 100644 --- a/src/jdk.incubator.jpackage/windows/native/libjpackage/jpackage.cpp +++ b/src/jdk.jpackage/windows/native/libjpackage/jpackage.cpp @@ -34,12 +34,12 @@ extern "C" { #endif /* - * Class: jdk_incubator_jpackage_internal_ExecutableRebrander + * Class: jdk_jpackage_internal_ExecutableRebrander * Method: lockResource * Signature: (Ljava/lang/String;)J */ JNIEXPORT jlong JNICALL - Java_jdk_incubator_jpackage_internal_ExecutableRebrander_lockResource( + Java_jdk_jpackage_internal_ExecutableRebrander_lockResource( JNIEnv *pEnv, jclass c, jstring jExecutable) { JP_TRY; @@ -55,12 +55,12 @@ extern "C" { } /* - * Class: jdk_incubator_jpackage_internal_ExecutableRebrander + * Class: jdk_jpackage_internal_ExecutableRebrander * Method: unlockResource * Signature: (J;)V */ JNIEXPORT void JNICALL - Java_jdk_incubator_jpackage_internal_ExecutableRebrander_unlockResource( + Java_jdk_jpackage_internal_ExecutableRebrander_unlockResource( JNIEnv *pEnv, jclass c, jlong jResourceLock) { JP_TRY; @@ -70,12 +70,12 @@ extern "C" { } /* - * Class: jdk_incubator_jpackage_internal_ExecutableRebrander + * Class: jdk_jpackage_internal_ExecutableRebrander * Method: iconSwap * Signature: (J;Ljava/lang/String;)I */ JNIEXPORT jint JNICALL - Java_jdk_incubator_jpackage_internal_ExecutableRebrander_iconSwap( + Java_jdk_jpackage_internal_ExecutableRebrander_iconSwap( JNIEnv *pEnv, jclass c, jlong jResourceLock, jstring jIconTarget) { JP_TRY; @@ -94,12 +94,12 @@ extern "C" { } /* - * Class: jdk_incubator_jpackage_internal_ExecutableRebrander + * Class: jdk_jpackage_internal_ExecutableRebrander * Method: versionSwap * Signature: (J;[Ljava/lang/String;)I */ JNIEXPORT jint JNICALL - Java_jdk_incubator_jpackage_internal_ExecutableRebrander_versionSwap( + Java_jdk_jpackage_internal_ExecutableRebrander_versionSwap( JNIEnv *pEnv, jclass c, jlong jResourceLock, jobjectArray jExecutableProperties) { @@ -129,11 +129,11 @@ extern "C" { } /* - * Class: jdk_incubator_jpackage_internal_WinExeBundler + * Class: jdk_jpackage_internal_WinExeBundler * Method: embedMSI * Signature: (J;Ljava/lang/String;)I */ - JNIEXPORT jint JNICALL Java_jdk_incubator_jpackage_internal_WinExeBundler_embedMSI( + JNIEXPORT jint JNICALL Java_jdk_jpackage_internal_WinExeBundler_embedMSI( JNIEnv *pEnv, jclass c, jlong jResourceLock, jstring jmsiPath) { JP_TRY; diff --git a/src/jdk.incubator.jpackage/windows/native/libwixhelper/libwixhelper.cpp b/src/jdk.jpackage/windows/native/libwixhelper/libwixhelper.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/libwixhelper/libwixhelper.cpp rename to src/jdk.jpackage/windows/native/libwixhelper/libwixhelper.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/msiwrapper/Executor.cpp b/src/jdk.jpackage/windows/native/msiwrapper/Executor.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/msiwrapper/Executor.cpp rename to src/jdk.jpackage/windows/native/msiwrapper/Executor.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/msiwrapper/Executor.h b/src/jdk.jpackage/windows/native/msiwrapper/Executor.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/msiwrapper/Executor.h rename to src/jdk.jpackage/windows/native/msiwrapper/Executor.h diff --git a/src/jdk.incubator.jpackage/windows/native/msiwrapper/MsiWrapper.cpp b/src/jdk.jpackage/windows/native/msiwrapper/MsiWrapper.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/msiwrapper/MsiWrapper.cpp rename to src/jdk.jpackage/windows/native/msiwrapper/MsiWrapper.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/msiwrapper/Resources.cpp b/src/jdk.jpackage/windows/native/msiwrapper/Resources.cpp similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/msiwrapper/Resources.cpp rename to src/jdk.jpackage/windows/native/msiwrapper/Resources.cpp diff --git a/src/jdk.incubator.jpackage/windows/native/msiwrapper/Resources.h b/src/jdk.jpackage/windows/native/msiwrapper/Resources.h similarity index 100% rename from src/jdk.incubator.jpackage/windows/native/msiwrapper/Resources.h rename to src/jdk.jpackage/windows/native/msiwrapper/Resources.h diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java index 0d99cc3b0b21c..610404b8738c2 100644 --- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java +++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/ConsoleIOContext.java @@ -833,6 +833,7 @@ public void replaceLastHistoryEntry(String source) { } it.remove(); in.getHistory().add(source); + in.getHistory().resetIndex(); } private static final long ESCAPE_TIMEOUT = 100; diff --git a/src/jdk.jshell/share/man/jshell.1 b/src/jdk.jshell/share/man/jshell.1 index 5fb056b0e3177..01d6a24b30aa9 100644 --- a/src/jdk.jshell/share/man/jshell.1 +++ b/src/jdk.jshell/share/man/jshell.1 @@ -1,4 +1,3 @@ -.\"t .\" Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. .\" @@ -8,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -20,9 +19,10 @@ .\" or visit www.oracle.com if you need additional information or have any .\" questions. .\" +.\"t .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JSHELL" "1" "2020" "JDK 15" "JDK Commands" +.TH "JSHELL" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.jstatd/share/man/jstatd.1 b/src/jdk.jstatd/share/man/jstatd.1 index 9e4a849eca7fa..88d3222c36474 100644 --- a/src/jdk.jstatd/share/man/jstatd.1 +++ b/src/jdk.jstatd/share/man/jstatd.1 @@ -7,7 +7,7 @@ .\" .\" This code is distributed in the hope that it will be useful, but WITHOUT .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" version 2 for more details (a copy is included in the LICENSE file that .\" accompanied this code). .\" @@ -21,7 +21,7 @@ .\" .\" Automatically generated by Pandoc 2.3.1 .\" -.TH "JSTATD" "1" "2020" "JDK 15" "JDK Commands" +.TH "JSTATD" "1" "2020" "JDK 16" "JDK Commands" .hy .SH NAME .PP diff --git a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java index d8074ddcbeac6..e62f6338a5075 100644 --- a/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java +++ b/src/jdk.unsupported/share/classes/sun/misc/Unsafe.java @@ -636,7 +636,6 @@ public void freeMemory(long address) { * @see #getInt(Object, long) */ @ForceInline - @SuppressWarnings("preview") public long objectFieldOffset(Field f) { if (f == null) { throw new NullPointerException(); @@ -646,7 +645,7 @@ public long objectFieldOffset(Field f) { throw new UnsupportedOperationException("can't get field offset on a hidden class: " + f); } if (declaringClass.isRecord()) { - throw new UnsupportedOperationException("can't get field offset on a record (preview): " + f); + throw new UnsupportedOperationException("can't get field offset on a record class: " + f); } return theInternalUnsafe.objectFieldOffset(f); } @@ -669,7 +668,6 @@ public long objectFieldOffset(Field f) { * @see #getInt(Object, long) */ @ForceInline - @SuppressWarnings("preview") public long staticFieldOffset(Field f) { if (f == null) { throw new NullPointerException(); @@ -679,7 +677,7 @@ public long staticFieldOffset(Field f) { throw new UnsupportedOperationException("can't get field offset on a hidden class: " + f); } if (declaringClass.isRecord()) { - throw new UnsupportedOperationException("can't get field offset on a record (preview): " + f); + throw new UnsupportedOperationException("can't get field offset on a record class: " + f); } return theInternalUnsafe.staticFieldOffset(f); } @@ -695,7 +693,6 @@ public long staticFieldOffset(Field f) { * this class. */ @ForceInline - @SuppressWarnings("preview") public Object staticFieldBase(Field f) { if (f == null) { throw new NullPointerException(); @@ -705,7 +702,7 @@ public Object staticFieldBase(Field f) { throw new UnsupportedOperationException("can't get base address on a hidden class: " + f); } if (declaringClass.isRecord()) { - throw new UnsupportedOperationException("can't get base address on a record (preview): " + f); + throw new UnsupportedOperationException("can't get base address on a record class: " + f); } return theInternalUnsafe.staticFieldBase(f); } diff --git a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java index 59fcd62d17222..273fff49eeec8 100644 --- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java +++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystem.java @@ -2907,11 +2907,16 @@ private int writeEXT(OutputStream os) throws IOException { // read NTFS, UNIX and ZIP64 data from cen.extra private void readExtra(ZipFileSystem zipfs) throws IOException { + // Note that Section 4.5, Extensible data fields, of the PKWARE ZIP File + // Format Specification does not mandate a specific order for the + // data in the extra field, therefore Zip FS cannot assume the data + // is written in the same order by Zip libraries as Zip FS. if (extra == null) return; int elen = extra.length; int off = 0; int newOff = 0; + boolean hasZip64LocOffset = false; while (off + 4 < elen) { // extra spec: HeaderID+DataSize+Data int pos = off; @@ -2955,7 +2960,7 @@ private void readExtra(ZipFileSystem zipfs) throws IOException { ctime = winToJavaTime(LL(extra, pos + 20)); break; case EXTID_EXTT: - // spec says the Extened timestamp in cen only has mtime + // spec says the Extended timestamp in cen only has mtime // need to read the loc to get the extra a/ctime, if flag // "zipinfo-time" is not specified to false; // there is performance cost (move up to loc and read) to @@ -2965,44 +2970,15 @@ private void readExtra(ZipFileSystem zipfs) throws IOException { mtime = unixToJavaTime(LG(extra, pos + 1)); break; } - byte[] buf = new byte[LOCHDR]; - if (zipfs.readFullyAt(buf, 0, buf.length , locoff) - != buf.length) - throw new ZipException("loc: reading failed"); - if (!locSigAt(buf, 0)) - throw new ZipException("loc: wrong sig ->" - + Long.toString(getSig(buf, 0), 16)); - int locElen = LOCEXT(buf); - if (locElen < 9) // EXTT is at least 9 bytes - break; - int locNlen = LOCNAM(buf); - buf = new byte[locElen]; - if (zipfs.readFullyAt(buf, 0, buf.length , locoff + LOCHDR + locNlen) - != buf.length) - throw new ZipException("loc extra: reading failed"); - int locPos = 0; - while (locPos + 4 < buf.length) { - int locTag = SH(buf, locPos); - int locSZ = SH(buf, locPos + 2); - locPos += 4; - if (locTag != EXTID_EXTT) { - locPos += locSZ; - continue; - } - int end = locPos + locSZ - 4; - int flag = CH(buf, locPos++); - if ((flag & 0x1) != 0 && locPos <= end) { - mtime = unixToJavaTime(LG(buf, locPos)); - locPos += 4; - } - if ((flag & 0x2) != 0 && locPos <= end) { - atime = unixToJavaTime(LG(buf, locPos)); - locPos += 4; - } - if ((flag & 0x4) != 0 && locPos <= end) { - ctime = unixToJavaTime(LG(buf, locPos)); - } - break; + // If the LOC offset is 0xFFFFFFFF, then we need to read the + // LOC offset from the EXTID_ZIP64 extra data. Therefore + // wait until all of the CEN extra data fields have been processed + // prior to reading the LOC extra data field in order to obtain + // the Info-ZIP Extended Timestamp. + if (locoff != ZIP64_MINVAL) { + readLocEXTT(zipfs); + } else { + hasZip64LocOffset = true; } break; default: // unknown tag @@ -3011,12 +2987,66 @@ private void readExtra(ZipFileSystem zipfs) throws IOException { } off += (sz + 4); } + + // We need to read the LOC extra data and the LOC offset was obtained + // from the EXTID_ZIP64 field. + if (hasZip64LocOffset) { + readLocEXTT(zipfs); + } + if (newOff != 0 && newOff != extra.length) extra = Arrays.copyOf(extra, newOff); else extra = null; } + /** + * Read the LOC extra field to obtain the Info-ZIP Extended Timestamp fields + * @param zipfs The Zip FS to use + * @throws IOException If an error occurs + */ + private void readLocEXTT(ZipFileSystem zipfs) throws IOException { + byte[] buf = new byte[LOCHDR]; + if (zipfs.readFullyAt(buf, 0, buf.length , locoff) + != buf.length) + throw new ZipException("loc: reading failed"); + if (!locSigAt(buf, 0)) + throw new ZipException("R" + + Long.toString(getSig(buf, 0), 16)); + int locElen = LOCEXT(buf); + if (locElen < 9) // EXTT is at least 9 bytes + return; + int locNlen = LOCNAM(buf); + buf = new byte[locElen]; + if (zipfs.readFullyAt(buf, 0, buf.length , locoff + LOCHDR + locNlen) + != buf.length) + throw new ZipException("loc extra: reading failed"); + int locPos = 0; + while (locPos + 4 < buf.length) { + int locTag = SH(buf, locPos); + int locSZ = SH(buf, locPos + 2); + locPos += 4; + if (locTag != EXTID_EXTT) { + locPos += locSZ; + continue; + } + int end = locPos + locSZ - 4; + int flag = CH(buf, locPos++); + if ((flag & 0x1) != 0 && locPos <= end) { + mtime = unixToJavaTime(LG(buf, locPos)); + locPos += 4; + } + if ((flag & 0x2) != 0 && locPos <= end) { + atime = unixToJavaTime(LG(buf, locPos)); + locPos += 4; + } + if ((flag & 0x4) != 0 && locPos <= end) { + ctime = unixToJavaTime(LG(buf, locPos)); + } + break; + } + } + @Override public String toString() { StringBuilder sb = new StringBuilder(1024); diff --git a/test/hotspot/jtreg/gc/TestReferenceRefersTo.java b/test/hotspot/jtreg/gc/TestReferenceRefersTo.java new file mode 100644 index 0000000000000..09d4fec3d14a2 --- /dev/null +++ b/test/hotspot/jtreg/gc/TestReferenceRefersTo.java @@ -0,0 +1,299 @@ +/* + * 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 gc; + +/* @test + * @requires vm.gc != "Epsilon" + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @modules java.base + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm + * -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * gc.TestReferenceRefersTo + */ + +import java.lang.ref.PhantomReference; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; +import sun.hotspot.WhiteBox; + +public class TestReferenceRefersTo { + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + + private static final class TestObject { + public final int value; + + public TestObject(int value) { + this.value = value; + } + } + + private static volatile TestObject testObjectNone = null; + private static volatile TestObject testObject1 = null; + private static volatile TestObject testObject2 = null; + private static volatile TestObject testObject3 = null; + private static volatile TestObject testObject4 = null; + + private static ReferenceQueue queue = null; + + private static PhantomReference testPhantom1 = null; + + private static WeakReference testWeak2 = null; + private static WeakReference testWeak3 = null; + private static WeakReference testWeak4 = null; + + private static void setup() { + testObjectNone = new TestObject(0); + testObject1 = new TestObject(1); + testObject2 = new TestObject(2); + testObject3 = new TestObject(3); + testObject4 = new TestObject(4); + + queue = new ReferenceQueue(); + + testPhantom1 = new PhantomReference(testObject1, queue); + + testWeak2 = new WeakReference(testObject2, queue); + testWeak3 = new WeakReference(testObject3, queue); + testWeak4 = new WeakReference(testObject4, queue); + } + + private static void gcUntilOld(Object o) throws Exception { + if (!WB.isObjectInOldGen(o)) { + WB.fullGC(); + if (!WB.isObjectInOldGen(o)) { + fail("object not promoted by full gc"); + } + } + } + + private static void gcUntilOld() throws Exception { + gcUntilOld(testObjectNone); + gcUntilOld(testObject1); + gcUntilOld(testObject2); + gcUntilOld(testObject3); + gcUntilOld(testObject4); + + gcUntilOld(testPhantom1); + + gcUntilOld(testWeak2); + gcUntilOld(testWeak3); + gcUntilOld(testWeak4); + } + + private static void progress(String msg) { + System.out.println(msg); + } + + private static void fail(String msg) throws Exception { + throw new RuntimeException(msg); + } + + private static void expectCleared(Reference ref, + String which) throws Exception { + expectNotValue(ref, testObjectNone, which); + if (!ref.refersTo(null)) { + fail("expected " + which + " to be cleared"); + } + } + + private static void expectNotCleared(Reference ref, + String which) throws Exception { + expectNotValue(ref, testObjectNone, which); + if (ref.refersTo(null)) { + fail("expected " + which + " to not be cleared"); + } + } + + private static void expectValue(Reference ref, + TestObject value, + String which) throws Exception { + expectNotValue(ref, testObjectNone, which); + expectNotCleared(ref, which); + if (!ref.refersTo(value)) { + fail(which + " doesn't refer to expected value"); + } + } + + private static void expectNotValue(Reference ref, + TestObject value, + String which) throws Exception { + if (ref.refersTo(value)) { + fail(which + " refers to unexpected value"); + } + } + + private static void checkInitialStates() throws Exception { + expectValue(testPhantom1, testObject1, "testPhantom1"); + expectValue(testWeak2, testObject2, "testWeak2"); + expectValue(testWeak3, testObject3, "testWeak3"); + expectValue(testWeak4, testObject4, "testWeak4"); + } + + private static void discardStrongReferences() { + // testObjectNone not dropped + testObject1 = null; + testObject2 = null; + // testObject3 not dropped + testObject4 = null; + } + + private static void testConcurrentCollection() throws Exception { + progress("setup concurrent collection test"); + setup(); + progress("gcUntilOld"); + gcUntilOld(); + + progress("acquire control of concurrent cycles"); + WB.concurrentGCAcquireControl(); + try { + progress("check initial states"); + checkInitialStates(); + + progress("discard strong references"); + discardStrongReferences(); + + progress("run GC to before marking completed"); + WB.concurrentGCRunTo(WB.BEFORE_MARKING_COMPLETED); + + progress("fetch test objects, possibly keeping some alive"); + expectNotCleared(testPhantom1, "testPhantom1"); + expectNotCleared(testWeak2, "testWeak2"); + expectValue(testWeak3, testObject3, "testWeak3"); + + // For some collectors, calling get() will keep testObject4 alive. + if (testWeak4.get() == null) { + fail("testWeak4 unexpectedly == null"); + } + + progress("finish collection"); + WB.concurrentGCRunToIdle(); + + progress("verify expected clears"); + expectCleared(testPhantom1, "testPhantom1"); + expectCleared(testWeak2, "testWeak2"); + expectValue(testWeak3, testObject3, "testWeak3"); + // This is true for all currently supported concurrent collectors. + expectNotCleared(testWeak4, "testWeak4"); + + progress("verify get returns expected values"); + if (testWeak2.get() != null) { + fail("testWeak2.get() != null"); + } + + TestObject obj3 = testWeak3.get(); + if (obj3 == null) { + fail("testWeak3.get() returned null"); + } else if (obj3.value != 3) { + fail("testWeak3.get().value is " + obj3.value); + } + + TestObject obj4 = testWeak4.get(); + if (obj4 == null) { + fail("testWeak4.get() returned null"); + } else if (obj4.value != 4) { + fail("testWeak4.get().value is " + obj4.value); + } + + progress("verify queue entries"); + long timeout = 60000; // 1 minute of milliseconds. + while (true) { + Reference ref = queue.remove(timeout); + if (ref == null) { + break; + } else if (ref == testPhantom1) { + testPhantom1 = null; + } else if (ref == testWeak2) { + testWeak2 = null; + } else if (ref == testWeak3) { + testWeak3 = null; + } else if (ref == testWeak4) { + testWeak4 = null; + } else { + fail("unexpected reference in queue"); + } + } + if (testPhantom1 != null) { + fail("testPhantom1 not notified"); + } else if (testWeak2 != null) { + fail("testWeak2 not notified"); + } else if (testWeak3 == null) { + fail("testWeak3 notified"); + } else if (testWeak4 == null) { + if (obj4 != null) { + fail("testWeak4 notified"); + } + } + + } finally { + progress("release control of concurrent cycles"); + WB.concurrentGCReleaseControl(); + } + progress("finished concurrent collection test"); + } + + private static void testSimpleCollection() throws Exception { + progress("setup simple collection test"); + setup(); + progress("gcUntilOld"); + gcUntilOld(); + + progress("check initial states"); + checkInitialStates(); + + progress("discard strong references"); + TestObject tw4 = testWeak4.get(); // Keep testObject4 alive. + discardStrongReferences(); + + progress("collect garbage"); + WB.fullGC(); + + progress("verify expected clears"); + expectCleared(testPhantom1, "testPhantom1"); + expectCleared(testWeak2, "testWeak2"); + expectValue(testWeak3, testObject3, "testWeak3"); + expectNotCleared(testWeak4, "testWeak4"); + + progress("verify get returns expected values"); + if (testWeak2.get() != null) { + fail("testWeak2.get() != null"); + } else if (testWeak3.get() != testObject3) { + fail("testWeak3.get() is not expected value"); + } else if (testWeak4.get() != tw4) { + fail("testWeak4.get() is not expected value"); + } + + progress("finished simple collection test"); + } + + public static void main(String[] args) throws Exception { + if (WB.supportsConcurrentGCBreakpoints()) { + testConcurrentCollection(); + } + testSimpleCollection(); + } +} diff --git a/test/hotspot/jtreg/gc/TestSoftReferencesBehaviorOnOOME.java b/test/hotspot/jtreg/gc/TestSoftReferencesBehaviorOnOOME.java index 12c246ca44d66..7f8442ccf0aa9 100644 --- a/test/hotspot/jtreg/gc/TestSoftReferencesBehaviorOnOOME.java +++ b/test/hotspot/jtreg/gc/TestSoftReferencesBehaviorOnOOME.java @@ -28,6 +28,7 @@ * @key randomness * @summary Tests that all SoftReferences has been cleared at time of OOM. * @requires vm.gc != "Z" + * @requires vm.gc != "Shenandoah" * @library /test/lib * @modules java.base/jdk.internal.misc * @run main/othervm -Xmx128m gc.TestSoftReferencesBehaviorOnOOME 512 2k diff --git a/test/hotspot/jtreg/runtime/cds/appcds/BadBSM.java b/test/hotspot/jtreg/runtime/cds/appcds/BadBSM.java index ae26d96d4560b..f7671662f1261 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/BadBSM.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/BadBSM.java @@ -42,7 +42,8 @@ public static void main(String[] args) throws Exception { OutputAnalyzer out = TestCommon.dump(appJar, TestCommon.list("WrongBSM", - "@lambda-proxy WrongBSM 7")); + "@lambda-proxy WrongBSM 7"), + "-Xlog:cds+lambda=debug"); out.shouldHaveExitValue(0); out.shouldContain( "is_supported_invokedynamic check failed for cp_index 7"); } diff --git a/test/hotspot/jtreg/runtime/cds/appcds/ClassListFormatBase.java b/test/hotspot/jtreg/runtime/cds/appcds/ClassListFormatBase.java index d7c848bb2018a..0fd55b4a4a0a4 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/ClassListFormatBase.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/ClassListFormatBase.java @@ -41,7 +41,7 @@ static void dumpShouldFail(String caseHelp, String appJar, String[] appClasses, System.out.println("------------------------------"); try { - OutputAnalyzer output = TestCommon.dump(appJar, appClasses); + OutputAnalyzer output = TestCommon.dump(appJar, appClasses, "-Xlog:cds+lambda=debug"); output.shouldHaveExitValue(1); for (String s : expected_errors) { output.shouldContain(s); @@ -63,7 +63,7 @@ static void dumpShouldPass(String caseHelp, String appJar, String[] appClasses, System.out.println("------------------------------"); try { - OutputAnalyzer output = TestCommon.dump(appJar, appClasses, "-Xlog:cds"); + OutputAnalyzer output = TestCommon.dump(appJar, appClasses, "-Xlog:cds", "-Xlog:cds+lambda=debug"); output.shouldHaveExitValue(0); output.shouldContain("Dumping"); for (String s : expected_msgs) { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/NewModuleFinderTest.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/NewModuleFinderTest.java index 93c50b2a459e2..7f2a3edb3fa6e 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/NewModuleFinderTest.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/NewModuleFinderTest.java @@ -70,6 +70,7 @@ public static void main(String... args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-Xlog:cds", "-Xlog:module=debug", + "-Dtest.src=" + TEST_SRC, "NewModuleFinderTest$Helper"); OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "exec"); out.shouldHaveExitValue(0); diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt index 63234eaabbc58..fc16e0f81d093 100644 --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -254,7 +254,6 @@ java/awt/image/DrawImage/IncorrectAlphaSurface2SW.java 8056077 generic-all java/awt/image/DrawImage/IncorrectClipXorModeSW2Surface.java 8196025 windows-all java/awt/image/DrawImage/IncorrectClipXorModeSurface2Surface.java 8196025 windows-all java/awt/image/DrawImage/IncorrectSourceOffset.java 8196086 windows-all -java/awt/image/DrawImage/IncorrectUnmanagedImageRotatedClip.java 8196087 windows-all java/awt/image/MultiResolutionImage/MultiResolutionDrawImageWithTransformTest.java 8198390 generic-all java/awt/image/multiresolution/MultiresolutionIconTest.java 8169187 macosx-all,windows-all java/awt/print/Headless/HeadlessPrinterJob.java 8196088 windows-all diff --git a/test/jdk/build/AbsPathsInImage.java b/test/jdk/build/AbsPathsInImage.java index e33bd0a9b1dff..c3fe885554e1d 100644 --- a/test/jdk/build/AbsPathsInImage.java +++ b/test/jdk/build/AbsPathsInImage.java @@ -168,12 +168,12 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO private void scanFile(Path file, List searchPatterns) throws IOException { List matches = scanBytes(Files.readAllBytes(file), searchPatterns); - // For the same reason as the *.dll above, the jdk.incubator.jpackage module + // For the same reason as the *.dll above, the jdk.jpackage module // contains some unavoidable header references in the launcher which is // stored as a java resource inside the modules file. if (IS_WINDOWS && file.toString().endsWith("modules")) { matches = matches.stream() - .filter(f -> !f.matches(".*jdk\\.incubator\\.jpackage.*\\.h.*")) + .filter(f -> !f.matches(".*jdk\\.jpackage.*\\.h.*")) .collect(Collectors.toList()); } if (matches.size() > 0) { diff --git a/test/jdk/com/sun/net/httpserver/HttpPrincipalTest.java b/test/jdk/com/sun/net/httpserver/HttpPrincipalTest.java index 954232441bf8a..30cf0c4490c7f 100644 --- a/test/jdk/com/sun/net/httpserver/HttpPrincipalTest.java +++ b/test/jdk/com/sun/net/httpserver/HttpPrincipalTest.java @@ -36,9 +36,13 @@ public class HttpPrincipalTest { @Test - public void TestGetters() { + public void testGetters() { var principal = new HttpPrincipal("test", "123"); + assertEquals(principal.getUsername(), "test"); assertEquals(principal.getRealm(), "123"); + assertEquals(principal.getName(), "123:test"); + assertEquals(principal.toString(), principal.getName()); + assertEquals(("test"+"123").hashCode(), principal.hashCode()); } } diff --git a/test/jdk/java/awt/image/DrawImage/IncorrectUnmanagedImageRotatedClip.java b/test/jdk/java/awt/image/DrawImage/IncorrectUnmanagedImageRotatedClip.java index 52b06c9021b99..a942e30378354 100644 --- a/test/jdk/java/awt/image/DrawImage/IncorrectUnmanagedImageRotatedClip.java +++ b/test/jdk/java/awt/image/DrawImage/IncorrectUnmanagedImageRotatedClip.java @@ -48,7 +48,9 @@ * @bug 8059942 * @summary Tests rotated clip when unmanaged image is drawn to VI. * Results of the blit to compatibleImage are used for comparison. - * @author Sergey Bylokhov + * @run main/othervm -Dsun.java2d.uiScale=1 IncorrectUnmanagedImageRotatedClip + * @run main/othervm -Dsun.java2d.uiScale=2 IncorrectUnmanagedImageRotatedClip + * @run main/othervm -Dsun.java2d.uiScale=3 IncorrectUnmanagedImageRotatedClip */ public final class IncorrectUnmanagedImageRotatedClip { diff --git a/test/jdk/java/io/InputStream/ReadNBytes.java b/test/jdk/java/io/InputStream/ReadNBytes.java index c4f643a7c5cd2..daac3d05a7f64 100644 --- a/test/jdk/java/io/InputStream/ReadNBytes.java +++ b/test/jdk/java/io/InputStream/ReadNBytes.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,7 @@ /* * @test - * @bug 8080835 8139206 + * @bug 8080835 8139206 8254742 * @library /test/lib * @build jdk.test.lib.RandomFactory * @run main ReadNBytes @@ -44,6 +44,7 @@ public class ReadNBytes { private static Random generator = RandomFactory.getRandom(); public static void main(String[] args) throws IOException { + test(); test(new byte[]{1, 2, 3}); test(createRandomBytes(1024)); for (int shift : new int[] {13, 15, 17}) { @@ -135,6 +136,19 @@ static void test(int max) throws IOException { check(!in.isClosed(), "Stream unexpectedly closed"); } + static void test() throws IOException { + final int chunkSize = 8192; + int size = (10 + generator.nextInt(11))*chunkSize; + + byte[] buf = new byte[size]; + generator.nextBytes(buf); + InputStream s = new ThrottledByteArrayInputStream(buf); + + byte[] b = s.readNBytes(size); + + check(Arrays.equals(b, buf), "Arrays not equal"); + } + static byte[] createRandomBytes(int size) { byte[] bytes = new byte[size]; generator.nextBytes(bytes); @@ -150,11 +164,32 @@ static void check(boolean cond, Object ... failedArgs) { throw new RuntimeException(sb.toString()); } - static class WrapperInputStream extends FilterInputStream { private boolean closed; WrapperInputStream(InputStream in) { super(in); } @Override public void close() throws IOException { closed = true; in.close(); } boolean isClosed() { return closed; } } + + static class ThrottledByteArrayInputStream extends ByteArrayInputStream { + private int count = 0; + + ThrottledByteArrayInputStream(byte[] buf) { + super(buf); + } + + @Override + // + // Sometimes return zero or a smaller count than requested. + // + public int read(byte[] buf, int off, int len) { + if (generator.nextBoolean()) { + return 0; + } else if (++count / 3 == 0) { + len /= 3; + } + + return super.read(buf, off, len); + } + } } diff --git a/test/jdk/java/lang/invoke/defineHiddenClass/BasicTest.java b/test/jdk/java/lang/invoke/defineHiddenClass/BasicTest.java index a62067af971a8..b3b1651fa5957 100644 --- a/test/jdk/java/lang/invoke/defineHiddenClass/BasicTest.java +++ b/test/jdk/java/lang/invoke/defineHiddenClass/BasicTest.java @@ -31,7 +31,7 @@ * BadClassFileVersion.jcod * @build jdk.test.lib.Utils * jdk.test.lib.compiler.CompilerUtils - * @run testng/othervm --enable-preview BasicTest + * @run testng/othervm BasicTest */ import java.io.File; @@ -77,8 +77,7 @@ public class BasicTest { @BeforeTest static void setup() throws IOException { - compileSources(SRC_DIR, CLASSES_DIR, - "--enable-preview", "-source", String.valueOf(Runtime.version().feature())); + compileSources(SRC_DIR, CLASSES_DIR); hiddenClassBytes = Files.readAllBytes(CLASSES_DIR.resolve("HiddenClass.class")); // compile with --release 10 with no NestHost and NestMembers attribute diff --git a/test/jdk/java/lang/ref/ReferenceRefersTo.java b/test/jdk/java/lang/ref/ReferenceRefersTo.java new file mode 100644 index 0000000000000..8ccaf4f3d534f --- /dev/null +++ b/test/jdk/java/lang/ref/ReferenceRefersTo.java @@ -0,0 +1,80 @@ +/* + * 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. + */ + +/* + * @test + * @bug 8188055 + * @summary Basic functional test of Reference.refersTo. + */ + +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.PhantomReference; +import java.lang.ref.SoftReference; +import java.lang.ref.WeakReference; + +public class ReferenceRefersTo { + private static final void fail(String msg) throws Exception { + throw new RuntimeException(msg); + } + + private static final void test(T ref, + Object expectedValue, + Object unexpectedValue, + String kind) throws Exception { + if ((expectedValue != null) && ref.refersTo(null)) { + fail(kind + "refers to null"); + } + if (!ref.refersTo(expectedValue)) { + fail(kind + " doesn't refer to expected value"); + } + if (ref.refersTo(unexpectedValue)) { + fail(kind + " refers to unexpected value"); + } + } + + public static void main(String[] args) throws Exception { + var queue = new ReferenceQueue(); + + var obj0 = new Object(); + var obj1 = new Object(); + var obj2 = new Object(); + var obj3 = new Object(); + + var pref = new PhantomReference(obj0, queue); + var wref = new WeakReference(obj1); + var sref = new SoftReference(obj2); + + test(pref, obj0, obj3, "phantom"); + test(wref, obj1, obj3, "weak"); + test(sref, obj2, obj3, "soft"); + + pref.clear(); + wref.clear(); + sref.clear(); + + test(pref, null, obj3, "phantom"); + test(wref, null, obj3, "weak"); + test(sref, null, obj3, "soft"); + } +} diff --git a/test/jdk/java/nio/file/Path/PathOps.java b/test/jdk/java/nio/file/Path/PathOps.java index 69d0c85e4a808..d6992c8ed2c11 100644 --- a/test/jdk/java/nio/file/Path/PathOps.java +++ b/test/jdk/java/nio/file/Path/PathOps.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 6838333 6925932 7006126 8037945 8072495 8140449 + * @bug 4313887 6838333 6925932 7006126 8037945 8072495 8140449 8254876 * @summary Unit test for java.nio.file.Path path operations */ @@ -2042,6 +2042,18 @@ static void doUnixTests() { static void npes() { header("NullPointerException"); + try { + Path.of(null, "foo"); + throw new RuntimeException("NullPointerException not thrown"); + } catch (NullPointerException npe) { + } + + try { + Path.of("foo", null); + throw new RuntimeException("NullPointerException not thrown"); + } catch (NullPointerException npe) { + } + Path path = FileSystems.getDefault().getPath("foo"); try { diff --git a/test/jdk/javax/imageio/stream/StreamFlush.java b/test/jdk/javax/imageio/stream/StreamFlush.java index fe0569ee445ce..cea1baa4a0ca3 100644 --- a/test/jdk/javax/imageio/stream/StreamFlush.java +++ b/test/jdk/javax/imageio/stream/StreamFlush.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, 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 @@ -34,6 +34,8 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; import javax.imageio.ImageIO; import javax.imageio.stream.ImageOutputStream; @@ -44,14 +46,20 @@ public static void main(String[] args) throws IOException { ImageIO.setUseCache(true); // Create a FileImageOutputStream from a FileOutputStream - File temp1 = File.createTempFile("imageio", ".tmp"); - temp1.deleteOnExit(); - ImageOutputStream fios = ImageIO.createImageOutputStream(temp1); - + File temp1 = File.createTempFile("StreamFlush_fis_", ".tmp"); // Create a FileCacheImageOutputStream from a BufferedOutputStream - File temp2 = File.createTempFile("imageio", ".tmp"); - temp2.deleteOnExit(); - FileOutputStream fos2 = new FileOutputStream(temp2); + File temp2 = File.createTempFile("StreamFlush_bos_", ".tmp"); + try (ImageOutputStream fios = ImageIO.createImageOutputStream(temp1); + FileOutputStream fos2 = new FileOutputStream(temp2)) { + test(temp1, fios, temp2, fos2); + } finally { + Files.delete(Paths.get(temp1.getAbsolutePath())); + Files.delete(Paths.get(temp2.getAbsolutePath())); + } + } + + private static void test(File temp1, ImageOutputStream fios, File temp2, + FileOutputStream fos2) throws IOException { BufferedOutputStream bos = new BufferedOutputStream(fos2); ImageOutputStream fcios1 = ImageIO.createImageOutputStream(bos); diff --git a/test/jdk/jdk/nio/zipfs/TestLocOffsetFromZip64EF.java b/test/jdk/jdk/nio/zipfs/TestLocOffsetFromZip64EF.java new file mode 100644 index 0000000000000..f38aa0d062907 --- /dev/null +++ b/test/jdk/jdk/nio/zipfs/TestLocOffsetFromZip64EF.java @@ -0,0 +1,213 @@ +/* + * 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. + */ + +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipFile; + +import static java.lang.String.format; + +/** + * @test + * @bug 8255380 + * @summary Test that Zip FS can access the LOC offset from the Zip64 extra field + * @modules jdk.zipfs + * @requires (os.family == "linux") | (os.family == "mac") + * @run testng/manual TestLocOffsetFromZip64EF + */ +public class TestLocOffsetFromZip64EF { + + private static final String ZIP_FILE_NAME = "LargeZipTest.zip"; + // File that will be created with a size greater than 0xFFFFFFFF + private static final String LARGE_FILE_NAME = "LargeZipEntry.txt"; + // File that will be created with a size less than 0xFFFFFFFF + private static final String SMALL_FILE_NAME = "SmallZipEntry.txt"; + // The size (4GB) of the large file to be created + private static final long LARGE_FILE_SIZE = 4L * 1024L * 1024L * 1024L; + + /** + * Create the files used by this test + * @throws IOException if an error occurs + */ + @BeforeClass + public void setUp() throws IOException { + System.out.println("In setup"); + cleanup(); + createFiles(); + createZipWithZip64Ext(); + } + + /** + * Delete files used by this test + * @throws IOException if an error occurs + */ + @AfterClass + public void cleanup() throws IOException { + System.out.println("In cleanup"); + Files.deleteIfExists(Path.of(ZIP_FILE_NAME)); + Files.deleteIfExists(Path.of(LARGE_FILE_NAME)); + Files.deleteIfExists(Path.of(SMALL_FILE_NAME)); + } + + /** + * Create a Zip file that will result in the an Zip64 Extra (EXT) header + * being added to the CEN entry in order to find the LOC offset for + * SMALL_FILE_NAME. + */ + public static void createZipWithZip64Ext() { + System.out.println("Executing zip..."); + List commands = List.of("zip", "-0", ZIP_FILE_NAME, + LARGE_FILE_NAME, SMALL_FILE_NAME); + Result rc = run(new ProcessBuilder(commands)); + rc.assertSuccess(); + } + + /** + * Navigate through the Zip file entries using Zip FS + * @throws IOException if an error occurs + */ + @Test + public void walkZipFSTest() throws IOException { + try (FileSystem fs = + FileSystems.newFileSystem(Paths.get(ZIP_FILE_NAME), Map.of("zipinfo-time", "False"))) { + for (Path root : fs.getRootDirectories()) { + Files.walkFileTree(root, new SimpleFileVisitor<>() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes + attrs) throws IOException { + System.out.println(Files.readAttributes(file, + BasicFileAttributes.class).toString()); + return FileVisitResult.CONTINUE; + } + }); + } + } + } + + /** + * Navigate through the Zip file entries using ZipFile + * @throws IOException if an error occurs + */ + @Test + public void walkZipFileTest() throws IOException { + try (ZipFile zip = new ZipFile(ZIP_FILE_NAME)) { + zip.stream().forEach(z -> System.out.printf("%s, %s, %s%n", + z.getName(), z.getMethod(), z.getLastModifiedTime())); + } + } + + /** + * Create the files that will be added to the ZIP file + * @throws IOException if there is a problem creating the files + */ + private static void createFiles() throws IOException { + try (RandomAccessFile file = new RandomAccessFile(LARGE_FILE_NAME, "rw") + ) { + System.out.printf("Creating %s%n", LARGE_FILE_NAME); + file.setLength(LARGE_FILE_SIZE); + System.out.printf("Creating %s%n", SMALL_FILE_NAME); + Files.writeString(Path.of(SMALL_FILE_NAME), "Hello"); + } + } + + /** + * Utility method to execute a ProcessBuilder command + * @param pb ProcessBuilder to execute + * @return The Result(s) from the ProcessBuilder execution + */ + private static Result run(ProcessBuilder pb) { + Process p; + System.out.printf("Running: %s%n", pb.command()); + try { + p = pb.start(); + } catch (IOException e) { + throw new RuntimeException( + format("Couldn't start process '%s'", pb.command()), e); + } + + String output; + try { + output = toString(p.getInputStream(), p.getErrorStream()); + } catch (IOException e) { + throw new RuntimeException( + format("Couldn't read process output '%s'", pb.command()), e); + } + + try { + p.waitFor(); + } catch (InterruptedException e) { + throw new RuntimeException( + format("Process hasn't finished '%s'", pb.command()), e); + } + return new Result(p.exitValue(), output); + } + + /** + * Utility Method for combining the output from a ProcessBuilder invocation + * @param in1 ProccessBuilder.getInputStream + * @param in2 ProcessBuilder.getErrorStream + * @return The ProcessBuilder output + * @throws IOException if an error occurs + */ + static String toString(InputStream in1, InputStream in2) throws IOException { + try (ByteArrayOutputStream dst = new ByteArrayOutputStream(); + InputStream concatenated = new SequenceInputStream(in1, in2)) { + concatenated.transferTo(dst); + return new String(dst.toByteArray(), StandardCharsets.UTF_8); + } + } + + /** + * Utility class used to hold the results from a ProcessBuilder execution + */ + static class Result { + final int ec; + final String output; + + private Result(int ec, String output) { + this.ec = ec; + this.output = output; + } + Result assertSuccess() { + assertTrue(ec == 0, "Expected ec 0, got: ", ec, " , output [", output, "]"); + return this; + } + } + static void assertTrue(boolean cond, Object ... failedArgs) { + if (cond) + return; + StringBuilder sb = new StringBuilder(); + for (Object o : failedArgs) + sb.append(o); + Assert.fail(sb.toString()); + } +} diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/AdditionalLauncher.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/AdditionalLauncher.java index 6aaa1375d0193..2e60facc8e431 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/AdditionalLauncher.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/AdditionalLauncher.java @@ -32,7 +32,7 @@ import java.util.Optional; import java.util.function.BiConsumer; import java.util.stream.Stream; -import jdk.incubator.jpackage.internal.ApplicationLayout; +import jdk.jpackage.internal.ApplicationLayout; import jdk.jpackage.test.Functional.ThrowingBiConsumer; public final class AdditionalLauncher { diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/FileAssociations.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/FileAssociations.java index 732cbb9240f08..ceb0dedcb6fa8 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/FileAssociations.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/FileAssociations.java @@ -25,7 +25,7 @@ import java.nio.file.Path; import java.util.HashMap; import java.util.Map; -import jdk.incubator.jpackage.internal.IOUtils; +import jdk.jpackage.internal.IOUtils; final public class FileAssociations { diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java index b8f10693f827e..a164a0728cac0 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java @@ -46,8 +46,8 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.incubator.jpackage.internal.AppImageFile; -import jdk.incubator.jpackage.internal.ApplicationLayout; +import jdk.jpackage.internal.AppImageFile; +import jdk.jpackage.internal.ApplicationLayout; import jdk.jpackage.test.Functional.ThrowingConsumer; import jdk.jpackage.test.Functional.ThrowingFunction; import jdk.jpackage.test.Functional.ThrowingSupplier; @@ -835,15 +835,6 @@ public static String escapeAndJoin(List args) { }).collect(Collectors.joining(" ")); } - public static Stream filterOutput(Stream jpackageOutput) { - // Skip "WARNING: Using incubator ..." first line of output - return jpackageOutput.skip(1); - } - - public static List filterOutput(List jpackageOutput) { - return filterOutput(jpackageOutput.stream()).collect(Collectors.toList()); - } - @Override protected boolean isMutable() { return !immutable; diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LauncherIconVerifier.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LauncherIconVerifier.java index 4ef62b28fc01f..d907a046f22eb 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LauncherIconVerifier.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LauncherIconVerifier.java @@ -85,7 +85,7 @@ public static Path getDefaultIcon() { } return TKit.SRC_ROOT.resolve(Path.of(components[0], - "classes/jdk/incubator/jpackage/internal/resources", components[1])); + "classes/jdk/jpackage/internal/resources", components[1])); } private String launcherName; diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LinuxHelper.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LinuxHelper.java index 787f4418f1d49..c54ca8865675f 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LinuxHelper.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/LinuxHelper.java @@ -38,7 +38,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.incubator.jpackage.internal.IOUtils; +import jdk.jpackage.internal.IOUtils; import jdk.jpackage.test.PackageTest.PackageHandlers; diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageTest.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageTest.java index 0acb196c2bac7..f81fb1c170cb5 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageTest.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageTest.java @@ -43,8 +43,8 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; -import jdk.incubator.jpackage.internal.AppImageFile; -import jdk.incubator.jpackage.internal.ApplicationLayout; +import jdk.jpackage.internal.AppImageFile; +import jdk.jpackage.internal.ApplicationLayout; import jdk.jpackage.test.Functional.ThrowingBiConsumer; import jdk.jpackage.test.Functional.ThrowingConsumer; import jdk.jpackage.test.Functional.ThrowingRunnable; diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java index 7f9eb811d6e25..26a1b7786a4a5 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java @@ -35,15 +35,15 @@ */ public enum PackageType { WIN_MSI(".msi", - TKit.isWindows() ? "jdk.incubator.jpackage.internal.WinMsiBundler" : null), + TKit.isWindows() ? "jdk.jpackage.internal.WinMsiBundler" : null), WIN_EXE(".exe", - TKit.isWindows() ? "jdk.incubator.jpackage.internal.WinMsiBundler" : null), + TKit.isWindows() ? "jdk.jpackage.internal.WinMsiBundler" : null), LINUX_DEB(".deb", - TKit.isLinux() ? "jdk.incubator.jpackage.internal.LinuxDebBundler" : null), + TKit.isLinux() ? "jdk.jpackage.internal.LinuxDebBundler" : null), LINUX_RPM(".rpm", - TKit.isLinux() ? "jdk.incubator.jpackage.internal.LinuxRpmBundler" : null), - MAC_DMG(".dmg", TKit.isOSX() ? "jdk.incubator.jpackage.internal.MacDmgBundler" : null), - MAC_PKG(".pkg", TKit.isOSX() ? "jdk.incubator.jpackage.internal.MacPkgBundler" : null), + TKit.isLinux() ? "jdk.jpackage.internal.LinuxRpmBundler" : null), + MAC_DMG(".dmg", TKit.isOSX() ? "jdk.jpackage.internal.MacDmgBundler" : null), + MAC_PKG(".pkg", TKit.isOSX() ? "jdk.jpackage.internal.MacPkgBundler" : null), IMAGE("app-image", null, null); PackageType(String packageName, String bundleSuffix, String bundlerClass) { diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java index d35539b3f50cc..4f97752305be5 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java @@ -81,7 +81,7 @@ final public class TKit { }).get(); public static final Path SRC_ROOT = Functional.identity(() -> { - return TEST_SRC_ROOT.resolve("../../../../src/jdk.incubator.jpackage").normalize().toAbsolutePath(); + return TEST_SRC_ROOT.resolve("../../../../src/jdk.jpackage").normalize().toAbsolutePath(); }).get(); public final static String ICON_SUFFIX = Functional.identity(() -> { diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/AppImageFileTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/AppImageFileTest.java similarity index 99% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/AppImageFileTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/AppImageFileTest.java index 8168148ef6cc2..e2b8116d980d8 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/AppImageFileTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/AppImageFileTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/ApplicationLayoutTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/ApplicationLayoutTest.java similarity index 98% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/ApplicationLayoutTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/ApplicationLayoutTest.java index 7ef0a4d15bde1..0d8e4a1abfd2e 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/ApplicationLayoutTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/ApplicationLayoutTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/CompareDottedVersionTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/CompareDottedVersionTest.java similarity index 98% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/CompareDottedVersionTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/CompareDottedVersionTest.java index 283bbe26fea5f..b8057d0e2b445 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/CompareDottedVersionTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/CompareDottedVersionTest.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.ArrayList; import java.util.List; diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/DeployParamsTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/DeployParamsTest.java similarity index 99% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/DeployParamsTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/DeployParamsTest.java index bfb3d359ef2d9..cf398a2d6b9e5 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/DeployParamsTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/DeployParamsTest.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.nio.file.Path; import java.io.IOException; diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/DottedVersionTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/DottedVersionTest.java similarity index 98% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/DottedVersionTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/DottedVersionTest.java index d6ace3d88b1e6..fedf153d5dddd 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/DottedVersionTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/DottedVersionTest.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.Collections; import java.util.List; diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/InvalidDottedVersionTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/InvalidDottedVersionTest.java similarity index 98% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/InvalidDottedVersionTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/InvalidDottedVersionTest.java index 710545803321a..674a4ac24efa7 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/InvalidDottedVersionTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/InvalidDottedVersionTest.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.util.List; import java.util.stream.Collectors; diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/OverridableResourceTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/OverridableResourceTest.java similarity index 98% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/OverridableResourceTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/OverridableResourceTest.java index 5a9041796b2d8..a4825c6415035 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/OverridableResourceTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/OverridableResourceTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.io.InputStream; @@ -33,7 +33,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import jdk.incubator.jpackage.internal.resources.ResourceLocator; +import jdk.jpackage.internal.resources.ResourceLocator; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.assertArrayEquals; diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/PathGroupTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/PathGroupTest.java similarity index 99% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/PathGroupTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/PathGroupTest.java index dbd0fd84b4555..3a005d102346e 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/PathGroupTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/PathGroupTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.io.IOException; import java.nio.file.Files; diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/PlatformVersionTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/PlatformVersionTest.java similarity index 96% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/PlatformVersionTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/PlatformVersionTest.java index 2780d69b8b8e0..355dc25a2fe6f 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/PlatformVersionTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/PlatformVersionTest.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; @@ -109,9 +109,9 @@ public void testIt() { private final boolean valid; private final static Function MAC_CFBUNDLE_VERSION_PARSER = findParser( - "jdk.incubator.jpackage.internal.CFBundleVersion"); + "jdk.jpackage.internal.CFBundleVersion"); private final static Function WIN_MSI_PRODUCT_VERSION_PARSER = findParser( - "jdk.incubator.jpackage.internal.MsiVersion"); + "jdk.jpackage.internal.MsiVersion"); private static Function findParser(String className) { try { diff --git a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/ToolValidatorTest.java b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/ToolValidatorTest.java similarity index 98% rename from test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/ToolValidatorTest.java rename to test/jdk/tools/jpackage/junit/jdk/jpackage/internal/ToolValidatorTest.java index adb579b929d30..3d0e2b0bb7849 100644 --- a/test/jdk/tools/jpackage/junit/jdk/incubator/jpackage/internal/ToolValidatorTest.java +++ b/test/jdk/tools/jpackage/junit/jdk/jpackage/internal/ToolValidatorTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.incubator.jpackage.internal; +package jdk.jpackage.internal; import java.nio.file.Path; import static org.hamcrest.CoreMatchers.is; diff --git a/test/jdk/tools/jpackage/junit/junit.java b/test/jdk/tools/jpackage/junit/junit.java index ce9441baf49d5..1073a5720789b 100644 --- a/test/jdk/tools/jpackage/junit/junit.java +++ b/test/jdk/tools/jpackage/junit/junit.java @@ -27,6 +27,6 @@ * @test * @summary jpackage unit tests * @library ${jtreg.home}/lib/junit.jar - * @modules jdk.incubator.jpackage + * @modules jdk.jpackage * @run shell run_junit.sh */ diff --git a/test/jdk/tools/jpackage/junit/run_junit.sh b/test/jdk/tools/jpackage/junit/run_junit.sh index 46c588a707728..496ac71a974b2 100644 --- a/test/jdk/tools/jpackage/junit/run_junit.sh +++ b/test/jdk/tools/jpackage/junit/run_junit.sh @@ -17,10 +17,10 @@ for s in $(find "${TESTSRC}" -name "*.java" | grep -v junit.java); do done common_args=(\ - --add-modules jdk.incubator.jpackage \ - --patch-module jdk.incubator.jpackage="${TESTSRC}${PS}${TESTCLASSES}" \ - --add-reads jdk.incubator.jpackage=ALL-UNNAMED \ - --add-exports jdk.incubator.jpackage/jdk.incubator.jpackage.internal=ALL-UNNAMED \ + --add-modules jdk.jpackage \ + --patch-module jdk.jpackage="${TESTSRC}${PS}${TESTCLASSES}" \ + --add-reads jdk.jpackage=ALL-UNNAMED \ + --add-exports jdk.jpackage/jdk.jpackage.internal=ALL-UNNAMED \ -classpath "${TESTCLASSPATH}" \ ) diff --git a/test/jdk/tools/jpackage/linux/AppCategoryTest.java b/test/jdk/tools/jpackage/linux/AppCategoryTest.java index a4471cebfc97f..978beff0c75bd 100644 --- a/test/jdk/tools/jpackage/linux/AppCategoryTest.java +++ b/test/jdk/tools/jpackage/linux/AppCategoryTest.java @@ -47,7 +47,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "linux") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=360 -Xmx512m AppCategoryTest */ public class AppCategoryTest { diff --git a/test/jdk/tools/jpackage/linux/LicenseTypeTest.java b/test/jdk/tools/jpackage/linux/LicenseTypeTest.java index 811288c33faa1..7462c3d17669d 100644 --- a/test/jdk/tools/jpackage/linux/LicenseTypeTest.java +++ b/test/jdk/tools/jpackage/linux/LicenseTypeTest.java @@ -42,7 +42,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "linux") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=360 -Xmx512m LicenseTypeTest */ public class LicenseTypeTest { diff --git a/test/jdk/tools/jpackage/linux/LinuxBundleNameTest.java b/test/jdk/tools/jpackage/linux/LinuxBundleNameTest.java index 5e3cf3a6421d1..be502d10a6044 100644 --- a/test/jdk/tools/jpackage/linux/LinuxBundleNameTest.java +++ b/test/jdk/tools/jpackage/linux/LinuxBundleNameTest.java @@ -47,7 +47,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "linux") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=360 -Xmx512m LinuxBundleNameTest */ public class LinuxBundleNameTest { diff --git a/test/jdk/tools/jpackage/linux/LinuxResourceTest.java b/test/jdk/tools/jpackage/linux/LinuxResourceTest.java index 30f6e0b1203ba..9f4e4cfad2f79 100644 --- a/test/jdk/tools/jpackage/linux/LinuxResourceTest.java +++ b/test/jdk/tools/jpackage/linux/LinuxResourceTest.java @@ -36,7 +36,7 @@ * @library ../helpers * @build jdk.jpackage.test.* * @requires (os.family == "linux") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile LinuxResourceTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=LinuxResourceTest diff --git a/test/jdk/tools/jpackage/linux/MaintainerTest.java b/test/jdk/tools/jpackage/linux/MaintainerTest.java index 51ffb35938504..82f433a6341ac 100644 --- a/test/jdk/tools/jpackage/linux/MaintainerTest.java +++ b/test/jdk/tools/jpackage/linux/MaintainerTest.java @@ -43,7 +43,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "linux") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=360 -Xmx512m MaintainerTest */ public class MaintainerTest { diff --git a/test/jdk/tools/jpackage/linux/PackageDepsTest.java b/test/jdk/tools/jpackage/linux/PackageDepsTest.java index 03066b49c124c..457d8f01592c4 100644 --- a/test/jdk/tools/jpackage/linux/PackageDepsTest.java +++ b/test/jdk/tools/jpackage/linux/PackageDepsTest.java @@ -50,7 +50,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "linux") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile PackageDepsTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=PackageDepsTest diff --git a/test/jdk/tools/jpackage/linux/ReleaseTest.java b/test/jdk/tools/jpackage/linux/ReleaseTest.java index c9197874c94d1..ed79cd6e184a1 100644 --- a/test/jdk/tools/jpackage/linux/ReleaseTest.java +++ b/test/jdk/tools/jpackage/linux/ReleaseTest.java @@ -46,7 +46,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "linux") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=360 -Xmx512m ReleaseTest */ public class ReleaseTest { diff --git a/test/jdk/tools/jpackage/linux/ShortcutHintTest.java b/test/jdk/tools/jpackage/linux/ShortcutHintTest.java index 3715d98fc9698..812a194133309 100644 --- a/test/jdk/tools/jpackage/linux/ShortcutHintTest.java +++ b/test/jdk/tools/jpackage/linux/ShortcutHintTest.java @@ -58,7 +58,7 @@ * @requires jpackage.test.SQETest == null * @build jdk.jpackage.test.* * @requires (os.family == "linux") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ShortcutHintTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=ShortcutHintTest @@ -72,7 +72,7 @@ * @build jdk.jpackage.test.* * @requires (os.family == "linux") * @requires jpackage.test.SQETest != null - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ShortcutHintTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=ShortcutHintTest.testBasic diff --git a/test/jdk/tools/jpackage/linux/jdk/jpackage/tests/UsrTreeTest.java b/test/jdk/tools/jpackage/linux/jdk/jpackage/tests/UsrTreeTest.java index 7a349175f0e96..13237cc5aa3da 100644 --- a/test/jdk/tools/jpackage/linux/jdk/jpackage/tests/UsrTreeTest.java +++ b/test/jdk/tools/jpackage/linux/jdk/jpackage/tests/UsrTreeTest.java @@ -45,7 +45,7 @@ * @requires jpackage.test.SQETest == null * @requires (os.family == "linux") * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile UsrTreeTest.java * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=UsrTreeTest diff --git a/test/jdk/tools/jpackage/macosx/MacFileAssociationsTest.java b/test/jdk/tools/jpackage/macosx/MacFileAssociationsTest.java index b2d3a7ea9a242..eb21419c3b382 100644 --- a/test/jdk/tools/jpackage/macosx/MacFileAssociationsTest.java +++ b/test/jdk/tools/jpackage/macosx/MacFileAssociationsTest.java @@ -41,7 +41,7 @@ * @summary jpackage with --file-associations and mac specific file association args * @library ../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @requires (os.family == "mac") * @run main/othervm -Xmx512m MacFileAssociationsTest */ diff --git a/test/jdk/tools/jpackage/macosx/MacPropertiesTest.java b/test/jdk/tools/jpackage/macosx/MacPropertiesTest.java index 3051a44d7a32c..9d4324e22227f 100644 --- a/test/jdk/tools/jpackage/macosx/MacPropertiesTest.java +++ b/test/jdk/tools/jpackage/macosx/MacPropertiesTest.java @@ -38,7 +38,7 @@ * @library ../helpers * @build jdk.jpackage.test.* * @requires (os.family == "mac") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile MacPropertiesTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=MacPropertiesTest diff --git a/test/jdk/tools/jpackage/macosx/NameWithSpaceTest.java b/test/jdk/tools/jpackage/macosx/NameWithSpaceTest.java index 3168bb2409028..ac505e5ca8100 100644 --- a/test/jdk/tools/jpackage/macosx/NameWithSpaceTest.java +++ b/test/jdk/tools/jpackage/macosx/NameWithSpaceTest.java @@ -40,7 +40,7 @@ * @summary jpackage test with name containing spaces * @library ../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile NameWithSpaceTest.java * @requires (os.family == "mac") * @key jpackagePlatformPackage diff --git a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java index ae07d38a5fdbb..b0f5f6e028f38 100644 --- a/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningAppImageTest.java @@ -49,7 +49,7 @@ * @build SigningCheck * @build jtreg.SkippedException * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @requires (os.family == "mac") * @run main/othervm -Xmx512m SigningAppImageTest */ diff --git a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java index af7981a291b4c..660a828a121cf 100644 --- a/test/jdk/tools/jpackage/macosx/SigningPackageTest.java +++ b/test/jdk/tools/jpackage/macosx/SigningPackageTest.java @@ -54,7 +54,7 @@ * @build SigningCheck * @build jtreg.SkippedException * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @requires (os.family == "mac") * @run main/othervm -Xmx512m SigningPackageTest */ diff --git a/test/jdk/tools/jpackage/macosx/base/SigningCheck.java b/test/jdk/tools/jpackage/macosx/base/SigningCheck.java index 2f247b0726302..3d0b4a44e34e3 100644 --- a/test/jdk/tools/jpackage/macosx/base/SigningCheck.java +++ b/test/jdk/tools/jpackage/macosx/base/SigningCheck.java @@ -29,7 +29,7 @@ import jdk.jpackage.test.TKit; import jdk.jpackage.test.Executor; -import jdk.incubator.jpackage.internal.MacCertificate; +import jdk.jpackage.internal.MacCertificate; public class SigningCheck { diff --git a/test/jdk/tools/jpackage/share/AddLauncherTest.java b/test/jdk/tools/jpackage/share/AddLauncherTest.java index 2c0edc9d26cfd..9bd45549eef87 100644 --- a/test/jdk/tools/jpackage/share/AddLauncherTest.java +++ b/test/jdk/tools/jpackage/share/AddLauncherTest.java @@ -50,7 +50,7 @@ * @requires (jpackage.test.SQETest != null) * @library ../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile AddLauncherTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=AddLauncherTest.test @@ -63,7 +63,7 @@ * @requires (jpackage.test.SQETest == null) * @library ../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile AddLauncherTest.java * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=AddLauncherTest diff --git a/test/jdk/tools/jpackage/share/AppImagePackageTest.java b/test/jdk/tools/jpackage/share/AppImagePackageTest.java index 2ee998af4472b..9065494e0e966 100644 --- a/test/jdk/tools/jpackage/share/AppImagePackageTest.java +++ b/test/jdk/tools/jpackage/share/AppImagePackageTest.java @@ -45,7 +45,7 @@ * @library ../helpers * @requires (jpackage.test.SQETest == null) * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile AppImagePackageTest.java * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=AppImagePackageTest diff --git a/test/jdk/tools/jpackage/share/ArgumentsTest.java b/test/jdk/tools/jpackage/share/ArgumentsTest.java index 1cc6f71531734..8cb8fc9365871 100644 --- a/test/jdk/tools/jpackage/share/ArgumentsTest.java +++ b/test/jdk/tools/jpackage/share/ArgumentsTest.java @@ -49,7 +49,7 @@ * @summary jpackage create image with --arguments test * @library ../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ArgumentsTest.java * @run main/othervm -Xmx512m jdk.jpackage.test.Main * --jpt-run=ArgumentsTest diff --git a/test/jdk/tools/jpackage/share/EmptyFolderPackageTest.java b/test/jdk/tools/jpackage/share/EmptyFolderPackageTest.java index 89ef1ba7a3875..90b53a478dc5b 100644 --- a/test/jdk/tools/jpackage/share/EmptyFolderPackageTest.java +++ b/test/jdk/tools/jpackage/share/EmptyFolderPackageTest.java @@ -22,7 +22,7 @@ */ import java.nio.file.Path; -import jdk.incubator.jpackage.internal.ApplicationLayout; +import jdk.jpackage.internal.ApplicationLayout; import jdk.jpackage.test.PackageTest; import jdk.jpackage.test.PackageType; import jdk.jpackage.test.TKit; @@ -39,7 +39,7 @@ * @key jpackagePlatformPackage * @build EmptyFolderBase * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=720 -Xmx512m EmptyFolderPackageTest */ public class EmptyFolderPackageTest { diff --git a/test/jdk/tools/jpackage/share/EmptyFolderTest.java b/test/jdk/tools/jpackage/share/EmptyFolderTest.java index aefaeadbddc18..873f08c3fbed4 100644 --- a/test/jdk/tools/jpackage/share/EmptyFolderTest.java +++ b/test/jdk/tools/jpackage/share/EmptyFolderTest.java @@ -24,7 +24,7 @@ import java.nio.file.Path; import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.TKit; -import jdk.incubator.jpackage.internal.ApplicationLayout; +import jdk.jpackage.internal.ApplicationLayout; /** * Tests generation of app image with input folder containing empty folders. @@ -37,7 +37,7 @@ * @library /test/lib * @build EmptyFolderBase * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm -Xmx512m EmptyFolderTest */ public class EmptyFolderTest { diff --git a/test/jdk/tools/jpackage/share/FileAssociationsTest.java b/test/jdk/tools/jpackage/share/FileAssociationsTest.java index fcad5e7d15dba..52dd20f9297b1 100644 --- a/test/jdk/tools/jpackage/share/FileAssociationsTest.java +++ b/test/jdk/tools/jpackage/share/FileAssociationsTest.java @@ -61,7 +61,7 @@ * @key jpackagePlatformPackage * @requires jpackage.test.SQETest == null * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile FileAssociationsTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=FileAssociationsTest @@ -74,7 +74,7 @@ * @key jpackagePlatformPackage * @requires jpackage.test.SQETest != null * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile FileAssociationsTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=FileAssociationsTest.test diff --git a/test/jdk/tools/jpackage/share/IconTest.java b/test/jdk/tools/jpackage/share/IconTest.java index eeb138ef5f258..cf86be917d2a7 100644 --- a/test/jdk/tools/jpackage/share/IconTest.java +++ b/test/jdk/tools/jpackage/share/IconTest.java @@ -51,7 +51,7 @@ * @summary jpackage create image and package with custom icons for the main and additional launcher * @library ../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile IconTest.java * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=IconTest diff --git a/test/jdk/tools/jpackage/share/InstallDirTest.java b/test/jdk/tools/jpackage/share/InstallDirTest.java index e49132d25b56a..1f969149c688e 100644 --- a/test/jdk/tools/jpackage/share/InstallDirTest.java +++ b/test/jdk/tools/jpackage/share/InstallDirTest.java @@ -58,7 +58,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @compile InstallDirTest.java - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=InstallDirTest.testCommon */ @@ -70,7 +70,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @compile InstallDirTest.java - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @requires (os.family == "linux") * @requires (jpackage.test.SQETest == null) * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main diff --git a/test/jdk/tools/jpackage/share/LicenseTest.java b/test/jdk/tools/jpackage/share/LicenseTest.java index ed8c86c99c724..97e9cd1bfdd8f 100644 --- a/test/jdk/tools/jpackage/share/LicenseTest.java +++ b/test/jdk/tools/jpackage/share/LicenseTest.java @@ -67,7 +67,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @compile LicenseTest.java - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=LicenseTest.testCommon */ @@ -81,7 +81,7 @@ * @compile LicenseTest.java * @requires (os.family == "linux") * @requires (jpackage.test.SQETest == null) - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=1440 -Xmx512m jdk.jpackage.test.Main * --jpt-run=LicenseTest.testCustomDebianCopyright * --jpt-run=LicenseTest.testCustomDebianCopyrightSubst diff --git a/test/jdk/tools/jpackage/share/MultiLauncherTwoPhaseTest.java b/test/jdk/tools/jpackage/share/MultiLauncherTwoPhaseTest.java index 423ea5b960813..5df3609e3babf 100644 --- a/test/jdk/tools/jpackage/share/MultiLauncherTwoPhaseTest.java +++ b/test/jdk/tools/jpackage/share/MultiLauncherTwoPhaseTest.java @@ -47,7 +47,7 @@ * @library /test/lib * @key jpackagePlatformPackage * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile MultiLauncherTwoPhaseTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=MultiLauncherTwoPhaseTest diff --git a/test/jdk/tools/jpackage/share/RuntimePackageTest.java b/test/jdk/tools/jpackage/share/RuntimePackageTest.java index 94ecb12c8460b..9c4c24e3dcbd2 100644 --- a/test/jdk/tools/jpackage/share/RuntimePackageTest.java +++ b/test/jdk/tools/jpackage/share/RuntimePackageTest.java @@ -56,7 +56,7 @@ * @comment Temporary disable for OSX until functionality implemented * @requires (os.family != "mac") * @requires (jpackage.test.SQETest == null) - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile RuntimePackageTest.java * @run main/othervm/timeout=1400 -Xmx512m jdk.jpackage.test.Main * --jpt-run=RuntimePackageTest @@ -71,7 +71,7 @@ * @comment Temporary disable for OSX until functionality implemented * @requires (os.family != "mac") * @requires (jpackage.test.SQETest != null) - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile RuntimePackageTest.java * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=RuntimePackageTest.test diff --git a/test/jdk/tools/jpackage/share/SimplePackageTest.java b/test/jdk/tools/jpackage/share/SimplePackageTest.java index aaf2c7e2caf41..d2e8da31c031e 100644 --- a/test/jdk/tools/jpackage/share/SimplePackageTest.java +++ b/test/jdk/tools/jpackage/share/SimplePackageTest.java @@ -43,7 +43,7 @@ * @library ../helpers * @key jpackagePlatformPackage * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile SimplePackageTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=SimplePackageTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/AppVersionTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/AppVersionTest.java index 89ae306d7a703..f137fabf3d629 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/AppVersionTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/AppVersionTest.java @@ -30,13 +30,13 @@ import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; -import jdk.incubator.jpackage.internal.AppImageFile; +import jdk.jpackage.internal.AppImageFile; import jdk.jpackage.test.Annotations.Parameters; import jdk.jpackage.test.Annotations.Test; import jdk.jpackage.test.JPackageCommand; import jdk.jpackage.test.PackageTest; import jdk.jpackage.test.TKit; -import jdk.incubator.jpackage.internal.AppImageFile; +import jdk.jpackage.internal.AppImageFile; import org.w3c.dom.Document; /* @@ -44,7 +44,7 @@ * @summary jpackage application version testing * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile AppVersionTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.AppVersionTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/BasicTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/BasicTest.java index 33f476a5ddde2..c93c51ab24b88 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/BasicTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/BasicTest.java @@ -48,7 +48,7 @@ * @summary jpackage basic testing * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile BasicTest.java * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.BasicTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/CookedRuntimeTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/CookedRuntimeTest.java index 382836f07a964..f61fff69fe63a 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/CookedRuntimeTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/CookedRuntimeTest.java @@ -44,7 +44,7 @@ * @summary test '--runtime-image' option of jpackage * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile CookedRuntimeTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.CookedRuntimeTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ErrorTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ErrorTest.java index ba78f7caf076d..95f7ff9a12dbe 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ErrorTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ErrorTest.java @@ -35,7 +35,7 @@ * @summary jpackage application version testing * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ErrorTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.ErrorTest @@ -47,7 +47,7 @@ * @summary jpackage application version testing * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ErrorTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.ErrorTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JLinkOptionsTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JLinkOptionsTest.java index 50f22fe634ffc..5f97df482bf23 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JLinkOptionsTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JLinkOptionsTest.java @@ -35,7 +35,7 @@ * @summary jpackage application version testing * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile JLinkOptionsTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.JLinkOptionsTest @@ -92,7 +92,7 @@ public static Collection input() { // should have whatever it needs new String[]{"java.base", "com.other"}, // should not have whatever it doesn't need - new String[]{"jdk.incubator.jpackage"}, + new String[]{"jdk.jpackage"}, }, // bind-services and limit-options diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JavaOptionsEqualsTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JavaOptionsEqualsTest.java index 9858ce928b541..c63892a2ca060 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JavaOptionsEqualsTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JavaOptionsEqualsTest.java @@ -37,7 +37,7 @@ * @summary jpackage create image with --java-options test * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile JavaOptionsEqualsTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.JavaOptionsEqualsTest @@ -49,7 +49,7 @@ * @summary jpackage create image with --java-options test * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile JavaOptionsEqualsTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.JavaOptionsEqualsTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JavaOptionsTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JavaOptionsTest.java index 069ec10f3c10d..ab2f7a3d15d50 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JavaOptionsTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/JavaOptionsTest.java @@ -37,7 +37,7 @@ * @summary jpackage create image with --java-options test * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile JavaOptionsTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.JavaOptionsTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MainClassTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MainClassTest.java index bf0a6e34c06e0..c39b9d6ff6ed2 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MainClassTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MainClassTest.java @@ -53,7 +53,7 @@ * @summary test different settings of main class name for jpackage * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile MainClassTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.MainClassTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest.java index 77fa37ead7261..1c5ead2ad653c 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest.java @@ -46,7 +46,7 @@ * @summary jpackage with --module-path testing * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ModulePathTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.ModulePathTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest2.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest2.java index ef1bc9d4b1a36..7bfe998014caf 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest2.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest2.java @@ -38,7 +38,7 @@ * @summary jpackage with --module-path testing * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ModulePathTest2.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.ModulePathTest2 diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest3.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest3.java index d916fe5c7de3a..c7c33fa861738 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest3.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/ModulePathTest3.java @@ -32,7 +32,7 @@ import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; -import jdk.incubator.jpackage.internal.AppImageFile; +import jdk.jpackage.internal.AppImageFile; import jdk.jpackage.test.HelloApp; import jdk.jpackage.test.JavaAppDesc; import jdk.jpackage.test.Annotations.Test; @@ -51,7 +51,7 @@ * @summary jpackage for app's module linked in external runtime * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ModulePathTest3.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.ModulePathTest3 @@ -62,7 +62,7 @@ * @summary jpackage for app's module linked in external runtime * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile ModulePathTest3.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.ModulePathTest3 diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MultipleJarAppTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MultipleJarAppTest.java index ae0901b239c61..3ce9f62d8d271 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MultipleJarAppTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/MultipleJarAppTest.java @@ -35,7 +35,7 @@ * @summary jpackage application packed in multiple jars * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile MultipleJarAppTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.MultipleJarAppTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/NonExistentTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/NonExistentTest.java index 34844fbf882f6..3790c9002ca7e 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/NonExistentTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/NonExistentTest.java @@ -35,7 +35,7 @@ * @summary jpackage application version testing * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile NonExistentTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=jdk.jpackage.tests.NonExistentTest diff --git a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java index cd37e7ae6e316..10e2e38ec5cd9 100644 --- a/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java +++ b/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java @@ -35,7 +35,7 @@ * @summary test how app launcher handles unicode command line arguments * @library ../../../../helpers * @build jdk.jpackage.test.* - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile UnicodeArgsTest.java * @requires (os.family == "windows") * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main diff --git a/test/jdk/tools/jpackage/windows/WinConsoleTest.java b/test/jdk/tools/jpackage/windows/WinConsoleTest.java index 806b6bad26c6c..7a4e9ccfa5a0c 100644 --- a/test/jdk/tools/jpackage/windows/WinConsoleTest.java +++ b/test/jdk/tools/jpackage/windows/WinConsoleTest.java @@ -37,7 +37,7 @@ * @library ../helpers * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinConsoleTest.java * * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main diff --git a/test/jdk/tools/jpackage/windows/WinDirChooserTest.java b/test/jdk/tools/jpackage/windows/WinDirChooserTest.java index 5b994f4cf6846..f64a5b2c6e7e5 100644 --- a/test/jdk/tools/jpackage/windows/WinDirChooserTest.java +++ b/test/jdk/tools/jpackage/windows/WinDirChooserTest.java @@ -40,7 +40,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @run main/othervm/timeout=360 -Xmx512m WinDirChooserTest */ diff --git a/test/jdk/tools/jpackage/windows/WinL10nTest.java b/test/jdk/tools/jpackage/windows/WinL10nTest.java index 72496b9b6d5c0..4171da208a46c 100644 --- a/test/jdk/tools/jpackage/windows/WinL10nTest.java +++ b/test/jdk/tools/jpackage/windows/WinL10nTest.java @@ -42,7 +42,7 @@ * @requires (jpackage.test.SQETest == null) * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinL10nTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinL10nTest diff --git a/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java b/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java index 13691f9442433..b8b748a6ca1e9 100644 --- a/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java +++ b/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java @@ -43,7 +43,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinMenuGroupTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinMenuGroupTest diff --git a/test/jdk/tools/jpackage/windows/WinMenuTest.java b/test/jdk/tools/jpackage/windows/WinMenuTest.java index 15a3bf8734ad4..e39a16465fe84 100644 --- a/test/jdk/tools/jpackage/windows/WinMenuTest.java +++ b/test/jdk/tools/jpackage/windows/WinMenuTest.java @@ -40,7 +40,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinMenuTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinMenuTest diff --git a/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java b/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java index 6667ba401de0d..2020c27975b41 100644 --- a/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java +++ b/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java @@ -41,7 +41,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinPerUserInstallTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinPerUserInstallTest diff --git a/test/jdk/tools/jpackage/windows/WinResourceTest.java b/test/jdk/tools/jpackage/windows/WinResourceTest.java index 8200241a46827..c7610aafa33cb 100644 --- a/test/jdk/tools/jpackage/windows/WinResourceTest.java +++ b/test/jdk/tools/jpackage/windows/WinResourceTest.java @@ -42,7 +42,7 @@ * @library ../helpers * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinResourceTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinResourceTest diff --git a/test/jdk/tools/jpackage/windows/WinScriptTest.java b/test/jdk/tools/jpackage/windows/WinScriptTest.java index d807977375d8d..3a2f095152b64 100644 --- a/test/jdk/tools/jpackage/windows/WinScriptTest.java +++ b/test/jdk/tools/jpackage/windows/WinScriptTest.java @@ -25,7 +25,7 @@ import java.nio.file.Path; import java.util.List; import java.util.ArrayList; -import jdk.incubator.jpackage.internal.IOUtils; +import jdk.jpackage.internal.IOUtils; import jdk.jpackage.test.TKit; import jdk.jpackage.test.PackageTest; import jdk.jpackage.test.PackageType; @@ -40,7 +40,7 @@ * @library ../helpers * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinScriptTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinScriptTest diff --git a/test/jdk/tools/jpackage/windows/WinShortcutTest.java b/test/jdk/tools/jpackage/windows/WinShortcutTest.java index dbd2447b8571b..f50f07a89052d 100644 --- a/test/jdk/tools/jpackage/windows/WinShortcutTest.java +++ b/test/jdk/tools/jpackage/windows/WinShortcutTest.java @@ -41,7 +41,7 @@ * @key jpackagePlatformPackage * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinShortcutTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinShortcutTest diff --git a/test/jdk/tools/jpackage/windows/WinUpgradeUUIDTest.java b/test/jdk/tools/jpackage/windows/WinUpgradeUUIDTest.java index f1effb3f07b56..0c233b0e652a2 100644 --- a/test/jdk/tools/jpackage/windows/WinUpgradeUUIDTest.java +++ b/test/jdk/tools/jpackage/windows/WinUpgradeUUIDTest.java @@ -51,7 +51,7 @@ * @requires (jpackage.test.SQETest != null) * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinUpgradeUUIDTest.java * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinUpgradeUUIDTest.test @@ -65,7 +65,7 @@ * @requires (jpackage.test.SQETest == null) * @build jdk.jpackage.test.* * @requires (os.family == "windows") - * @modules jdk.incubator.jpackage/jdk.incubator.jpackage.internal + * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinUpgradeUUIDTest.java * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinUpgradeUUIDTest diff --git a/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java b/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java index 73bed39266e3d..e96d63cc869b1 100644 --- a/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java +++ b/test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java @@ -56,14 +56,6 @@ public void test() { """ - """, - // Bottom navbar - """ - Skip navigation links""", - // Bottom navbar - """ - - """); } } diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java index 437792bd80501..a8844065bfeb6 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java @@ -71,18 +71,7 @@ public void testDocFilesInModulePackages() { In a named module acme.module and named package p.""", "
            Since:Module""", - """ - Package""", - """ - Tree""", - """ - Deprecated""", - """ - Index""", - "phi-FOOTER-phi", + // check footer "phi-BOTTOM-phi" ); } @@ -119,18 +108,7 @@ public void testDocFilesInMultiModulePackagesWithRecursiveCopy() { In a named module acme.module and named package p.""", "
            Since:Module""", - """ - Package""", - """ - Tree""", - """ - Deprecated""", - """ - Index""", - "phi-FOOTER-phi", + // check footer "phi-BOTTOM-phi" ); @@ -151,18 +129,7 @@ public void testDocFilesInMultiModulePackagesWithRecursiveCopy() { Index""", "phi-HEADER-phi", "SubSubReadme.html at third level of doc-file directory.", - // check bottom navbar - """ - Module""", - """ - Package""", - """ - Tree""", - """ - Deprecated""", - """ - Index""", - "phi-FOOTER-phi", + // check footer "phi-BOTTOM-phi" ); } diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java index f48cba0ebe722..1577d6d563f03 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlLandmarkRegions/TestHtmlLandmarkRegions.java @@ -68,6 +68,7 @@ public void testModules(Path base) throws Exception { javadoc("-d", outDir.toString(), "-doctitle", "Document Title", "-header", "Test Header", + "-bottom", "bottom text", "--module-source-path", srcDir.toString(), "--module", "m1,m2"); @@ -82,8 +83,10 @@ public void testModules(Path base) throws Exception {

            Document Title

            """, """ -