diff --git a/.hgtags b/.hgtags index c24b50bd310..d213f1fbfe4 100644 --- a/.hgtags +++ b/.hgtags @@ -340,3 +340,5 @@ f242d4332f563648426a1b0fa02d8741beba19ef jdk9-b92 5ac6287ec71aafe021cc839d8bc828108d23aaba jdk-9+95 139f19d70350238e15e107945cea75082b6380b3 jdk-9+96 4edcff1b9a8875eb6380a2165dfec599e8e3f7c0 jdk-9+97 +d00ad2d9049ac60815f70bff445e95df85648bd2 jdk-9+98 +f9bcdce2df26678c3fe468130b535c0342c69b89 jdk-9+99 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 43b90b329b2..d10b68389a6 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -340,3 +340,5 @@ cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90 12a6fb4f070f8ca8fbca219ab9abf5da8908b317 jdk-9+95 5582a79892596169ebddb3e2c2aa44939e4e3f40 jdk-9+96 75c3897541ecb52ee16d001ea605b12971df7303 jdk-9+97 +48987460c7d49a29013963ee44d090194396bb61 jdk-9+98 +7c0577bea4c65d69c5bef67023a89d2efa4fb2f7 jdk-9+99 diff --git a/README b/README index e1fdec5d4ab..477b38887fc 100644 --- a/README +++ b/README @@ -6,7 +6,7 @@ README: The root repository can be obtained with something like: hg clone http://hg.openjdk.java.net/jdk9/jdk9 openjdk9 - + You can run the get_source.sh script located in the root repository to get the other needed repositories: cd openjdk9 && sh ./get_source.sh @@ -17,7 +17,7 @@ README: See http://openjdk.java.net/ for more information about OpenJDK. Simple Build Instructions: - + 0. Get the necessary system software/packages installed on your system, see http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html @@ -28,10 +28,10 @@ Simple Build Instructions: 2. Configure the build: bash ./configure - + 3. Build the OpenJDK: make all - The resulting JDK image should be found in build/*/images/j2sdk-image + The resulting JDK image should be found in build/*/images/jdk where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually is 3.81 or newer. Note that on Solaris, GNU make is called "gmake". diff --git a/README-builds.html b/README-builds.html index d81549d5ce4..42cc0f11b7c 100644 --- a/README-builds.html +++ b/README-builds.html @@ -250,9 +250,7 @@ Compilers, freetype, cups, and
Mac OS X
-Install XCode 4.5.2 and also -install the "Command line tools" found under the preferences pane -"Downloads"
Install XCode 6.3
@@ -279,39 +277,67 @@ OpenJDK.At a minimum, the Studio 12 Update 1 Compilers (containing -version 5.10 of the C and C++ compilers) is required, including specific +technetwork/server-storage/solarisstudio/downloads/index.htm">Studio 12 Update 4 Compilers (containing +version 5.13 of the C and C++ compilers) is required, including specific patches.
-The Solaris SPARC patch list is:
+The Solaris Studio installation should contain at least these packages:
-+-+ +
++ + + +Package +Version ++ +developer/solarisstudio-124/backend +12.4-1.0.6.0 ++ +developer/solarisstudio-124/c++ +12.4-1.0.10.0 ++ +developer/solarisstudio-124/cc +12.4-1.0.4.0 ++ +developer/solarisstudio-124/library/c++-libs +12.4-1.0.10.0 ++ +developer/solarisstudio-124/library/math-libs +12.4-1.0.0.1 ++ +developer/solarisstudio-124/library/studio-gccrt +12.4-1.0.0.1 ++ +developer/solarisstudio-124/studio-common +12.4-1.0.0.1 ++ +developer/solarisstudio-124/studio-ja +12.4-1.0.0.1 ++ +developer/solarisstudio-124/studio-legal +12.4-1.0.0.1 ++ + +developer/solarisstudio-124/studio-zhCN +12.4-1.0.0.1 +
The Solaris X86 patch list is:
- -In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc +version.
Place the bin
directory in PATH
.
With Linux, it was just a matter of picking a stable distribution that is a good representative for Linux in general.
-NOTE: We expect a change here from Fedora 9 to something else, but it has not -been completely determined yet, possibly Ubuntu 12.04 X64, unbiased community -feedback would be welcome on what a good choice would be here.
-It is understood that most developers will NOT be using these specific versions, and in fact creating these specific versions may be difficult due to the age of some of this software. It is expected that developers are more often @@ -1176,7 +1198,7 @@ so that they can be dealt with accordingly.
**Package** | +**Version** | +
developer/solarisstudio-124/backend | +12.4-1.0.6.0 | +
developer/solarisstudio-124/c++ | +12.4-1.0.10.0 | +
developer/solarisstudio-124/cc | +12.4-1.0.4.0 | +
developer/solarisstudio-124/library/c++-libs | +12.4-1.0.10.0 | +
developer/solarisstudio-124/library/math-libs | +12.4-1.0.0.1 | +
developer/solarisstudio-124/library/studio-gccrt | +12.4-1.0.0.1 | +
developer/solarisstudio-124/studio-common | +12.4-1.0.0.1 | +
developer/solarisstudio-124/studio-ja | +12.4-1.0.0.1 | +
developer/solarisstudio-124/studio-legal | +12.4-1.0.0.1 | +
developer/solarisstudio-124/studio-zhCN | +12.4-1.0.0.1 | +
Usage:
* *
- * Some Java types do not map naturally to a XML representation, for
+ * Some Java types do not map naturally to an XML representation, for
* example {@code HashMap} or other non JavaBean classes. Conversely,
- * a XML repsentation may map to a Java type but an application may
- * choose to accesss the XML representation using another Java
+ * an XML representation may map to a Java type but an application may
+ * choose to access the XML representation using another Java
* type. For example, the schema to Java binding rules bind
* xs:DateTime by default to XmlGregorianCalendar. But an application
* may desire to bind xs:DateTime to a custom type,
diff --git a/jdk/.hgtags b/jdk/.hgtags
index df834b681b3..2af851e8faa 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -340,3 +340,5 @@ b433e4dfb830fea60e5187e4580791b62cc362d2 jdk9-b90
8581faf0d474472e32f589bbc16db7eec912d83f jdk-9+95
c021b855f51e572e63982654b17742cb1f814fb4 jdk-9+96
fdd84b2265ddce7f50e084b7c8635189bba6f012 jdk-9+97
+f86ee68d1107dad41a27efc34306e0e56244a12e jdk-9+98
+e1a789be1535741274c9779f4d4ca3495196b5c3 jdk-9+99
diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk
index 90796dd0f1e..73f3edff8a0 100644
--- a/jdk/make/CompileDemos.gmk
+++ b/jdk/make/CompileDemos.gmk
@@ -309,7 +309,7 @@ define SetupBuildJvmtiDemoBody
ifeq ($$($1_TOOLCHAIN), TOOLCHAIN_LINK_CXX)
# For C++, we also need some special treatment.
- $1_LDFLAGS := $(LDFLAGS_CXX_JDK)
+ $1_LDFLAGS := $$(LDFLAGS_CXX_JDK)
$1_LIBS := $(LIBCXX)
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
@@ -324,9 +324,9 @@ define SetupBuildJvmtiDemoBody
OPTIMIZATION := LOW, \
CFLAGS := $$($1_CFLAGS_INCLUDE) $$(CFLAGS_JDKLIB) $$(CFLAGS_DEBUG_SYMBOLS), \
CXXFLAGS := $$($1_CXXFLAGS), \
- LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)) \
+ LDFLAGS := $(filter-out -incremental:no -opt:ref, $$(LDFLAGS_JDKLIB)) \
$$($1_LDFLAGS), \
- LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
+ LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN), \
LIBS := $$($1_LIBS), \
LIBS_solaris := -lc, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
diff --git a/jdk/make/launcher/Launcher-java.base.gmk b/jdk/make/launcher/Launcher-java.base.gmk
index abe829ad4d3..4214de4ec22 100644
--- a/jdk/make/launcher/Launcher-java.base.gmk
+++ b/jdk/make/launcher/Launcher-java.base.gmk
@@ -127,8 +127,7 @@ ifneq ($(BUILD_JEXEC_SRC), )
$(BUILD_JEXEC_INC), \
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC, \
- LDFLAGS := $(LDFLAGS_JDKEXE) \
- $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
+ LDFLAGS := $(LDFLAGS_JDKEXE), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \
OUTPUT_DIR := $(BUILD_JEXEC_DST_DIR), \
DEBUG_SYMBOLS := true, \
diff --git a/jdk/make/launcher/Launcher-jdk.accessibility.gmk b/jdk/make/launcher/Launcher-jdk.accessibility.gmk
index e2d25f989b9..e954e550f30 100644
--- a/jdk/make/launcher/Launcher-jdk.accessibility.gmk
+++ b/jdk/make/launcher/Launcher-jdk.accessibility.gmk
@@ -73,8 +73,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
$$(eval $$(call SetupNativeCompilation, BUILD_JACCESSINSPECTOR$1, \
SRC := $(TOPDIR)/jaccessinspector $(TOPDIR)/common \
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
- CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
- LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib User32.lib, \
+ CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
+ LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
+ LIBS := advapi32.lib user32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
PROGRAM := jaccessinspector$1, \
@@ -100,8 +101,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
$$(eval $$(call SetupNativeCompilation,BUILD_JACCESSWALKER$1, \
SRC := $(TOPDIR)/jaccesswalker $(TOPDIR)/common \
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
- CFLAGS :== $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
- LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib Comctl32.lib Gdi32.lib User32.lib, \
+ CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
+ LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
+ LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
PROGRAM := jaccesswalker$1, \
diff --git a/jdk/make/launcher/Launcher-jdk.pack200.gmk b/jdk/make/launcher/Launcher-jdk.pack200.gmk
index a5506b5fc16..55c03865f71 100644
--- a/jdk/make/launcher/Launcher-jdk.pack200.gmk
+++ b/jdk/make/launcher/Launcher-jdk.pack200.gmk
@@ -89,7 +89,6 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
MAPFILE := $(UNPACK_MAPFILE),\
LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
- $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \
LIBS_solaris := -lc, \
diff --git a/jdk/make/launcher/LauncherCommon.gmk b/jdk/make/launcher/LauncherCommon.gmk
index 4d8dff00433..aeee54a2d0a 100644
--- a/jdk/make/launcher/LauncherCommon.gmk
+++ b/jdk/make/launcher/LauncherCommon.gmk
@@ -25,6 +25,12 @@
include NativeCompilation.gmk
+# SetupNativeCompilation now supports debug symbols on macosx for hotspot.
+# Disable it here for the jdk binaries until we decide to enable them.
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+ ENABLE_DEBUG_SYMBOLS := false
+endif
+
# Prepare the find cache.
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher))
@@ -180,15 +186,12 @@ define SetupBuildLauncherBody
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
CFLAGS_windows := $$($1_CFLAGS_windows), \
- LDFLAGS := $(LDFLAGS_JDKEXE) \
+ LDFLAGS := $$(LDFLAGS_JDKEXE) \
$$(ORIGIN_ARG) \
$$($1_LDFLAGS), \
LDFLAGS_linux := \
- $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
- LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_NAME,$1), \
LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
- $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
MAPFILE := $$($1_MAPFILE), \
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
index af85b7e0566..08cd4d774ab 100644
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -683,7 +683,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
WARNINGS_AS_ERRORS_gcc := false, \
WARNINGS_AS_ERRORS_solstudio := false, \
MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
- LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
+ LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
LDFLAGS_macosx := -undefined dynamic_lookup, \
@@ -799,7 +799,7 @@ else # OPENJDK_TARGET_OS not windows
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
- LDFLAGS_macosx := -Xlinker -rpath -Xlinker @loader_path, \
+ LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
LIBS_solaris := $(X_LIBS) -lXrender, \
LIBS_macosx := -framework Cocoa, \
@@ -1034,7 +1034,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN) \
- -Xlinker -rpath -Xlinker @loader_path \
+ -Wl$(COMMA)-rpath$(COMMA)@loader_path \
-L$(INSTALL_LIBRARIES_HERE), \
LIBS := -lawt -losxapp -lawt_lwawt \
-framework Cocoa \
diff --git a/jdk/make/lib/Lib-java.instrument.gmk b/jdk/make/lib/Lib-java.instrument.gmk
index 76ff764ed36..834cdc2850d 100644
--- a/jdk/make/lib/Lib-java.instrument.gmk
+++ b/jdk/make/lib/Lib-java.instrument.gmk
@@ -65,7 +65,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
-L$(call FindLibDirForModule, java.base)/jli, \
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli) \
-L$(call FindLibDirForModule, java.base)/jli, \
- LDFLAGS_macosx := -Xlinker -all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \
+ LDFLAGS_macosx := -Wl$(COMMA)-all_load, \
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
LDFLAGS_windows := -export:Agent_OnAttach, \
LIBS := $(JDKLIB_LIBS), \
@@ -74,7 +74,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
LIBS_solaris := -ljli $(LIBDL), \
LIBS_aix := -liconv -ljli_static $(LIBDL), \
LIBS_macosx := -liconv -framework Cocoa -framework Security \
- -framework ApplicationServices, \
+ -framework ApplicationServices \
+ $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \
LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib \
$(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
diff --git a/jdk/make/lib/LibCommon.gmk b/jdk/make/lib/LibCommon.gmk
index d1bfc4ed3a5..68bdcc0a414 100644
--- a/jdk/make/lib/LibCommon.gmk
+++ b/jdk/make/lib/LibCommon.gmk
@@ -46,6 +46,12 @@ else
endif
endif
+# SetupNativeCompilation now supports debug symbols on macosx for hotspot.
+# Disable it here for the jdk libraries until we decide to enable them.
+ifeq ($(OPENJDK_TARGET_OS), macosx)
+ ENABLE_DEBUG_SYMBOLS := false
+endif
+
################################################################################
# Find the default set of src dirs for a native library.
# Param 1 - module name
diff --git a/jdk/make/mapfiles/libzip/mapfile-vers b/jdk/make/mapfiles/libzip/mapfile-vers
index ceace23f26d..c1ab48c10cf 100644
--- a/jdk/make/mapfiles/libzip/mapfile-vers
+++ b/jdk/make/mapfiles/libzip/mapfile-vers
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,6 @@
SUNWprivate_1.1 {
global:
- Java_java_util_jar_JarFile_getMetaInfEntryNames;
Java_java_util_zip_Adler32_update;
Java_java_util_zip_Adler32_updateBytes;
Java_java_util_zip_Adler32_updateByteBuffer;
@@ -48,25 +47,6 @@ SUNWprivate_1.1 {
Java_java_util_zip_Inflater_initIDs;
Java_java_util_zip_Inflater_reset;
Java_java_util_zip_Inflater_setDictionary;
- Java_java_util_zip_ZipFile_close;
- Java_java_util_zip_ZipFile_getCommentBytes;
- Java_java_util_zip_ZipFile_freeEntry;
- Java_java_util_zip_ZipFile_getEntry;
- Java_java_util_zip_ZipFile_getEntryBytes;
- Java_java_util_zip_ZipFile_getEntryCrc;
- Java_java_util_zip_ZipFile_getEntryCSize;
- Java_java_util_zip_ZipFile_getEntryFlag;
- Java_java_util_zip_ZipFile_getEntryMethod;
- Java_java_util_zip_ZipFile_getEntrySize;
- Java_java_util_zip_ZipFile_getEntryTime;
- Java_java_util_zip_ZipFile_getNextEntry;
- Java_java_util_zip_ZipFile_getZipMessage;
- Java_java_util_zip_ZipFile_getTotal;
- Java_java_util_zip_ZipFile_initIDs;
- Java_java_util_zip_ZipFile_open;
- Java_java_util_zip_ZipFile_read;
- Java_java_util_zip_ZipFile_startsWithLOC;
-
ZIP_Close;
ZIP_CRC32;
ZIP_FindEntry;
diff --git a/jdk/make/mapfiles/libzip/reorder-sparc b/jdk/make/mapfiles/libzip/reorder-sparc
index 154e7998a53..63b2ad6fc28 100644
--- a/jdk/make/mapfiles/libzip/reorder-sparc
+++ b/jdk/make/mapfiles/libzip/reorder-sparc
@@ -16,30 +16,14 @@ text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;
-text: .text%Java_java_util_zip_ZipFile_initIDs;
-text: .text%Java_java_util_zip_ZipFile_open;
-text: .text%Java_java_util_zip_ZipFile_getTotal;
-text: .text%Java_java_util_zip_ZipFile_startsWithLOC;
-text: .text%Java_java_util_zip_ZipFile_getEntry;
-text: .text%Java_java_util_zip_ZipFile_freeEntry;
-text: .text%Java_java_util_zip_ZipFile_getEntryTime;
-text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
-text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
-text: .text%Java_java_util_zip_ZipFile_getEntrySize;
-text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
-text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
-text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
text: .text%Java_java_util_zip_Inflater_initIDs;
text: .text%Java_java_util_zip_Inflater_init;
text: .text%inflateInit2_;
text: .text%zcalloc;
text: .text%Java_java_util_zip_Inflater_inflateBytes;
-text: .text%Java_java_util_zip_ZipFile_read;
text: .text%ZIP_Read;
text: .text%zcfree;
-text: .text%Java_java_util_jar_JarFile_getMetaInfEntryNames;
text: .text%Java_java_util_zip_Inflater_reset;
text: .text%Java_java_util_zip_Inflater_end;
text: .text%inflateEnd;
-text: .text%Java_java_util_zip_ZipFile_close;
text: .text%ZIP_Close;
diff --git a/jdk/make/mapfiles/libzip/reorder-sparcv9 b/jdk/make/mapfiles/libzip/reorder-sparcv9
index 89690b8dabb..caca118de98 100644
--- a/jdk/make/mapfiles/libzip/reorder-sparcv9
+++ b/jdk/make/mapfiles/libzip/reorder-sparcv9
@@ -15,19 +15,6 @@ text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;
-text: .text%Java_java_util_zip_ZipFile_initIDs;
-text: .text%Java_java_util_zip_ZipFile_open;
-text: .text%Java_java_util_zip_ZipFile_getTotal;
-text: .text%Java_java_util_zip_ZipFile_startsWithLOC;
-text: .text%Java_java_util_zip_ZipFile_getEntry;
-text: .text%Java_java_util_zip_ZipFile_freeEntry;
-text: .text%Java_java_util_zip_ZipFile_getEntryTime;
-text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
-text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
-text: .text%Java_java_util_zip_ZipFile_getEntrySize;
-text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
-text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
-text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
text: .text%Java_java_util_zip_Inflater_initIDs;
text: .text%Java_java_util_zip_Inflater_init;
text: .text%inflateInit2_;
@@ -35,7 +22,6 @@ text: .text%zcalloc;
text: .text%inflateReset;
text: .text%Java_java_util_zip_Inflater_inflateBytes;
text: .text%inflate;
-text: .text%Java_java_util_zip_ZipFile_read;
text: .text%ZIP_Read;
text: .text%zcfree;
text: .text%Java_java_util_jar_JarFile_getMetaInfEntryNames;
@@ -43,6 +29,5 @@ text: .text%ZIP_ReadEntry;
text: .text%InflateFully;
text: .text%inflateEnd;
text: .text%Java_java_util_zip_Inflater_reset;
-text: .text%Java_java_util_zip_ZipFile_close;
text: .text%ZIP_Close;
text: .text%Java_java_util_zip_Inflater_end;
diff --git a/jdk/make/mapfiles/libzip/reorder-x86 b/jdk/make/mapfiles/libzip/reorder-x86
index 746948315eb..dfd57c7752e 100644
--- a/jdk/make/mapfiles/libzip/reorder-x86
+++ b/jdk/make/mapfiles/libzip/reorder-x86
@@ -16,34 +16,16 @@ text: .text%ZIP_InflateFully;
text: .text%ZIP_Lock;
text: .text%ZIP_Unlock;
text: .text%ZIP_FreeEntry;
-text: .text%Java_java_util_zip_ZipFile_initIDs;
-text: .text%Java_java_util_zip_ZipFile_open;
-text: .text%Java_java_util_zip_ZipFile_getTotal;
-text: .text%Java_java_util_zip_ZipFile_startsWithLOC;
-text: .text%Java_java_util_zip_ZipFile_getEntry;
-text: .text%Java_java_util_zip_ZipFile_freeEntry;
-text: .text%Java_java_util_zip_ZipFile_getEntryTime;
-text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
-text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
-text: .text%Java_java_util_zip_ZipFile_getEntrySize;
-text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
-text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
-text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
-text: .text%Java_java_util_zip_Inflater_initIDs;
-text: .text%Java_java_util_zip_Inflater_init;
text: .text%inflateInit2_;
text: .text%zcalloc;
text: .text%inflateReset;
text: .text%Java_java_util_zip_Inflater_inflateBytes;
text: .text%inflate;
-text: .text%Java_java_util_zip_ZipFile_read;
text: .text%ZIP_Read;
text: .text%zcfree;
-text: .text%Java_java_util_jar_JarFile_getMetaInfEntryNames;
text: .text%ZIP_ReadEntry;
text: .text%InflateFully;
text: .text%inflateEnd;
text: .text%Java_java_util_zip_Inflater_reset;
-text: .text%Java_java_util_zip_ZipFile_close;
text: .text%ZIP_Close;
text: .text%Java_java_util_zip_Inflater_end;
diff --git a/jdk/src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java b/jdk/src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java
index 1528b9e16b8..d9ae5ebe334 100644
--- a/jdk/src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java
+++ b/jdk/src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java
@@ -29,7 +29,6 @@ import java.io.IOException;
import java.nio.channels.*;
import java.nio.channels.spi.*;
import java.util.*;
-import sun.misc.*;
/**
* An implementation of Selector for Linux 2.6+ kernels that uses
@@ -50,7 +49,7 @@ class EPollSelectorImpl
private Map Note: During the creation of a new {@link
+ * Thread#Thread(ThreadGroup,Runnable,String,long,boolean) thread}, it is
+ * possible to opt out of receiving initial values for inheritable
+ * thread-local variables.
+ *
* @author Josh Bloch and Doug Lea
* @see ThreadLocal
* @since 1.2
diff --git a/jdk/src/java.base/share/classes/java/lang/Math.java b/jdk/src/java.base/share/classes/java/lang/Math.java
index 1cd32bd3839..ddb953225a8 100644
--- a/jdk/src/java.base/share/classes/java/lang/Math.java
+++ b/jdk/src/java.base/share/classes/java/lang/Math.java
@@ -26,8 +26,8 @@
package java.lang;
import java.util.Random;
-import sun.misc.FloatConsts;
-import sun.misc.DoubleConsts;
+import jdk.internal.math.FloatConsts;
+import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;
/**
diff --git a/jdk/src/java.base/share/classes/java/lang/StackWalker.java b/jdk/src/java.base/share/classes/java/lang/StackWalker.java
index ec5e581b7a6..2950ca23252 100644
--- a/jdk/src/java.base/share/classes/java/lang/StackWalker.java
+++ b/jdk/src/java.base/share/classes/java/lang/StackWalker.java
@@ -304,8 +304,8 @@ public final class StackWalker {
}
/**
- * Returns a {@code StackWalker} instance with the given {@ocde options} specifying
- * the stack frame information it can access. If the given {@ocde options}
+ * Returns a {@code StackWalker} instance with the given {@code options} specifying
+ * the stack frame information it can access. If the given {@code options}
* is empty, this {@code StackWalker} is configured to skip all
* {@linkplain Option#SHOW_HIDDEN_FRAMES hidden frames} and no
* {@linkplain Option#RETAIN_CLASS_REFERENCE class reference} is retained.
diff --git a/jdk/src/java.base/share/classes/java/lang/StrictMath.java b/jdk/src/java.base/share/classes/java/lang/StrictMath.java
index 68bba059786..0c82f6afbf5 100644
--- a/jdk/src/java.base/share/classes/java/lang/StrictMath.java
+++ b/jdk/src/java.base/share/classes/java/lang/StrictMath.java
@@ -26,7 +26,7 @@
package java.lang;
import java.util.Random;
-import sun.misc.DoubleConsts;
+import jdk.internal.math.DoubleConsts;
import jdk.internal.HotSpotIntrinsicCandidate;
/**
diff --git a/jdk/src/java.base/share/classes/java/lang/StringUTF16.java b/jdk/src/java.base/share/classes/java/lang/StringUTF16.java
index c00d3ce0953..937f642ce8d 100644
--- a/jdk/src/java.base/share/classes/java/lang/StringUTF16.java
+++ b/jdk/src/java.base/share/classes/java/lang/StringUTF16.java
@@ -120,7 +120,8 @@ final class StringUTF16 {
public static byte[] toBytes(char[] value, int off, int len) {
byte[] val = newBytesFor(len);
for (int i = 0; i < len; i++) {
- putChar(val, i, value[off++]);
+ putChar(val, i, value[off]);
+ off++;
}
return val;
}
@@ -145,11 +146,14 @@ final class StringUTF16 {
@HotSpotIntrinsicCandidate
private static int compress(char[] src, int srcOff, byte[] dst, int dstOff, int len) {
for (int i = 0; i < len; i++) {
- int c = src[srcOff++];
- if (c >>> 8 != 0) {
- return 0;
+ char c = src[srcOff];
+ if (c > 0xFF) {
+ len = 0;
+ break;
}
- dst[dstOff++] = (byte)c;
+ dst[dstOff] = (byte)c;
+ srcOff++;
+ dstOff++;
}
return len;
}
@@ -160,11 +164,14 @@ final class StringUTF16 {
// We need a range check here because 'getChar' has no checks
checkBoundsOffCount(srcOff, len, src.length);
for (int i = 0; i < len; i++) {
- int c = getChar(src, srcOff++);
- if (c >>> 8 != 0) {
- return 0;
+ char c = getChar(src, srcOff);
+ if (c > 0xFF) {
+ len = 0;
+ break;
}
- dst[dstOff++] = (byte)c;
+ dst[dstOff] = (byte)c;
+ srcOff++;
+ dstOff++;
}
return len;
}
@@ -581,7 +588,7 @@ final class StringUTF16 {
bits |= cp;
putChar(result, i, cp);
}
- if (bits >>> 8 != 0) {
+ if (bits > 0xFF) {
return new String(result, UTF16);
} else {
return newString(result, 0, len);
@@ -678,7 +685,7 @@ final class StringUTF16 {
bits |= cp;
putChar(result, i, cp);
}
- if (bits >>> 8 != 0) {
+ if (bits > 0xFF) {
return new String(result, UTF16);
} else {
return newString(result, 0, len);
diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java
index cf44391082c..ea3ad405cfc 100644
--- a/jdk/src/java.base/share/classes/java/lang/System.java
+++ b/jdk/src/java.base/share/classes/java/lang/System.java
@@ -132,7 +132,7 @@ public final class System {
/* The security manager for the system.
*/
- private static volatile SecurityManager security = null;
+ private static volatile SecurityManager security;
/**
* Reassigns the "standard" input stream.
@@ -206,7 +206,7 @@ public final class System {
setErr0(err);
}
- private static volatile Console cons = null;
+ private static volatile Console cons;
/**
* Returns the unique {@link java.io.Console Console} object associated
* with the current Java virtual machine, if any.
@@ -216,12 +216,13 @@ public final class System {
* @since 1.6
*/
public static Console console() {
- if (cons == null) {
+ Console c = cons;
+ if (c == null) {
synchronized (System.class) {
- cons = SharedSecrets.getJavaIOAccess().console();
+ cons = c = SharedSecrets.getJavaIOAccess().console();
}
}
- return cons;
+ return c;
}
/**
diff --git a/jdk/src/java.base/share/classes/java/lang/Thread.java b/jdk/src/java.base/share/classes/java/lang/Thread.java
index 57f90384243..56935eabd34 100644
--- a/jdk/src/java.base/share/classes/java/lang/Thread.java
+++ b/jdk/src/java.base/share/classes/java/lang/Thread.java
@@ -207,12 +207,10 @@ class Thread implements Runnable {
/* For generating thread ID */
private static long threadSeqNumber;
- /* Java thread status for tools,
- * initialized to indicate thread 'not yet started'
+ /*
+ * Java thread status for tools, default indicates thread 'not yet started'
*/
-
- private volatile int threadStatus = 0;
-
+ private volatile int threadStatus;
private static synchronized long nextThreadID() {
return ++threadSeqNumber;
@@ -344,11 +342,11 @@ class Thread implements Runnable {
/**
* Initializes a Thread with the current AccessControlContext.
- * @see #init(ThreadGroup,Runnable,String,long,AccessControlContext)
+ * @see #init(ThreadGroup,Runnable,String,long,AccessControlContext,boolean)
*/
private void init(ThreadGroup g, Runnable target, String name,
long stackSize) {
- init(g, target, name, stackSize, null);
+ init(g, target, name, stackSize, null, true);
}
/**
@@ -361,9 +359,12 @@ class Thread implements Runnable {
* zero to indicate that this parameter is to be ignored.
* @param acc the AccessControlContext to inherit, or
* AccessController.getContext() if null
+ * @param inheritThreadLocals if {@code true}, inherit initial values for
+ * inheritable thread-locals from the constructing thread
*/
private void init(ThreadGroup g, Runnable target, String name,
- long stackSize, AccessControlContext acc) {
+ long stackSize, AccessControlContext acc,
+ boolean inheritThreadLocals) {
if (name == null) {
throw new NullPointerException("name cannot be null");
}
@@ -414,7 +415,7 @@ class Thread implements Runnable {
acc != null ? acc : AccessController.getContext();
this.target = target;
setPriority(priority);
- if (parent.inheritableThreadLocals != null)
+ if (inheritThreadLocals && parent.inheritableThreadLocals != null)
this.inheritableThreadLocals =
ThreadLocal.createInheritedMap(parent.inheritableThreadLocals);
/* Stash the specified stack size in case the VM cares */
@@ -468,7 +469,7 @@ class Thread implements Runnable {
* This is not a public constructor.
*/
Thread(Runnable target, AccessControlContext acc) {
- init(null, target, "Thread-" + nextThreadNum(), 0, acc);
+ init(null, target, "Thread-" + nextThreadNum(), 0, acc, true);
}
/**
@@ -677,6 +678,62 @@ class Thread implements Runnable {
init(group, target, name, stackSize);
}
+ /**
+ * Allocates a new {@code Thread} object so that it has {@code target}
+ * as its run object, has the specified {@code name} as its name,
+ * belongs to the thread group referred to by {@code group}, has
+ * the specified {@code stackSize}, and inherits initial values for
+ * {@linkplain InheritableThreadLocal inheritable thread-local} variables
+ * if {@code inheritThreadLocals} is {@code true}.
+ *
+ * This constructor is identical to {@link
+ * #Thread(ThreadGroup,Runnable,String,long)} with the added ability to
+ * suppress, or not, the inheriting of initial values for inheritable
+ * thread-local variables from the constructing thread. This allows for
+ * finer grain control over inheritable thread-locals. Care must be taken
+ * when passing a value of {@code false} for {@code inheritThreadLocals},
+ * as it may lead to unexpected behavior if the new thread executes code
+ * that expects a specific thread-local value to be inherited.
+ *
+ * Specifying a value of {@code true} for the {@code inheritThreadLocals}
+ * parameter will cause this constructor to behave exactly like the
+ * {@code Thread(ThreadGroup, Runnable, String, long)} constructor.
+ *
+ * @param group
+ * the thread group. If {@code null} and there is a security
+ * manager, the group is determined by {@linkplain
+ * SecurityManager#getThreadGroup SecurityManager.getThreadGroup()}.
+ * If there is not a security manager or {@code
+ * SecurityManager.getThreadGroup()} returns {@code null}, the group
+ * is set to the current thread's thread group.
+ *
+ * @param target
+ * the object whose {@code run} method is invoked when this thread
+ * is started. If {@code null}, this thread's run method is invoked.
+ *
+ * @param name
+ * the name of the new thread
+ *
+ * @param stackSize
+ * the desired stack size for the new thread, or zero to indicate
+ * that this parameter is to be ignored
+ *
+ * @param inheritThreadLocals
+ * if {@code true}, inherit initial values for inheritable
+ * thread-locals from the constructing thread, otherwise no initial
+ * values are inherited
+ *
+ * @throws SecurityException
+ * if the current thread cannot create a thread in the specified
+ * thread group
+ *
+ * @since 9
+ */
+ public Thread(ThreadGroup group, Runnable target, String name,
+ long stackSize, boolean inheritThreadLocals) {
+ init(group, target, name, stackSize, null, inheritThreadLocals);
+ }
+
/**
* Causes this thread to begin execution; the Java Virtual Machine
* calls the
+ * Cleaning actions are {@link #register(Object object, Runnable action) registered}
+ * to run after the cleaner is notified that the object has become
+ * phantom reachable.
+ * The cleaner uses {@link PhantomReference} and {@link ReferenceQueue} to be
+ * notified when the reachability
+ * changes.
+ *
+ * Each cleaner operates independently, managing the pending cleaning actions
+ * and handling threading and termination when the cleaner is no longer in use.
+ * Registering an object reference and corresponding cleaning action returns
+ * a {@link Cleanable Cleanable}. The most efficient use is to explicitly invoke
+ * the {@link Cleanable#clean clean} method when the object is closed or
+ * no longer needed.
+ * The cleaning action is a {@link Runnable} to be invoked at most once when
+ * the object has become phantom reachable unless it has already been explicitly cleaned.
+ * Note that the cleaning action must not refer to the object being registered.
+ * If so, the object will not become phantom reachable and the cleaning action
+ * will not be invoked automatically.
+ *
+ * The execution of the cleaning action is performed
+ * by a thread associated with the cleaner.
+ * All exceptions thrown by the cleaning action are ignored.
+ * The cleaner and other cleaning actions are not affected by
+ * exceptions in a cleaning action.
+ * The thread runs until all registered cleaning actions have
+ * completed and the cleaner itself is reclaimed by the garbage collector.
+ *
+ * The behavior of cleaners during {@link System#exit(int) System.exit}
+ * is implementation specific. No guarantees are made relating
+ * to whether cleaning actions are invoked or not.
+ *
+ * Unless otherwise noted, passing a {@code null} argument to a constructor or
+ * method in this class will cause a
+ * {@link java.lang.NullPointerException NullPointerException} to be thrown.
+ *
+ * @apiNote
+ * The cleaning action is invoked only after the associated object becomes
+ * phantom reachable, so it is important that the object implementing the
+ * cleaning action does not hold references to the object.
+ * In this example, a static class encapsulates the cleaning state and action.
+ * An "inner" class, anonymous or not, must not be used because it implicitly
+ * contains a reference to the outer instance, preventing it from becoming
+ * phantom reachable.
+ * The choice of a new cleaner or sharing an existing cleaner is determined
+ * by the use case.
+ *
+ * If the CleaningExample is used in a try-finally block then the
+ * {@code close} method calls the cleaning action.
+ * If the {@code close} method is not called, the cleaning action is called
+ * by the Cleaner when the CleaningExample instance has become phantom reachable.
+ *
+ *
+ * Cleaning actions should be prepared to be invoked concurrently with
+ * other cleaning actions.
+ * Typically the cleaning actions should be very quick to execute
+ * and not block. If the cleaning action blocks, it may delay processing
+ * other cleaning actions registered to the same cleaner.
+ * All cleaning actions registered to a cleaner should be mutually compatible.
+ * @since 9
+ */
+public final class Cleaner {
+
+ /**
+ * The Cleaner implementation.
+ */
+ final CleanerImpl impl;
+
+ static {
+ CleanerImpl.setCleanerImplAccess((Cleaner c) -> c.impl);
+ }
+
+ /**
+ * Construct a Cleaner implementation and start it.
+ */
+ private Cleaner() {
+ impl = new CleanerImpl();
+ }
+
+ /**
+ * Returns a new {@code Cleaner}.
+ *
+ * The cleaner creates a {@link Thread#setDaemon(boolean) daemon thread}
+ * to process the phantom reachable objects and to invoke cleaning actions.
+ * The {@linkplain java.lang.Thread#getContextClassLoader context class loader}
+ * of the thread is set to the
+ * {@link ClassLoader#getSystemClassLoader() system class loader}.
+ * The thread has no permissions, enforced only if a
+ * {@link java.lang.System#setSecurityManager(SecurityManager) SecurityManager is set}.
+ *
+ * The cleaner terminates when it is phantom reachable and all of the
+ * registered cleaning actions are complete.
+ *
+ * @return a new {@code Cleaner}
+ *
+ * @throws SecurityException if the current thread is not allowed to
+ * create or start the thread.
+ */
+ public static Cleaner create() {
+ Cleaner cleaner = new Cleaner();
+ cleaner.impl.start(cleaner, null);
+ return cleaner;
+ }
+
+ /**
+ * Returns a new {@code Cleaner} using a {@code Thread} from the {@code ThreadFactory}.
+ *
+ * A thread from the thread factory's {@link ThreadFactory#newThread(Runnable) newThread}
+ * method is set to be a {@link Thread#setDaemon(boolean) daemon thread}
+ * and started to process phantom reachable objects and invoke cleaning actions.
+ * On each call the {@link ThreadFactory#newThread(Runnable) thread factory}
+ * must provide a Thread that is suitable for performing the cleaning actions.
+ *
+ * The cleaner terminates when it is phantom reachable and all of the
+ * registered cleaning actions are complete.
+ *
+ * @param threadFactory a {@code ThreadFactory} to return a new {@code Thread}
+ * to process cleaning actions
+ * @return a new {@code Cleaner}
+ *
+ * @throws IllegalThreadStateException if the thread from the thread
+ * factory was {@link Thread.State#NEW not a new thread}.
+ * @throws SecurityException if the current thread is not allowed to
+ * create or start the thread.
+ */
+ public static Cleaner create(ThreadFactory threadFactory) {
+ Objects.requireNonNull(threadFactory, "threadFactory");
+ Cleaner cleaner = new Cleaner();
+ cleaner.impl.start(cleaner, threadFactory);
+ return cleaner;
+ }
+
+ /**
+ * Registers an object and a cleaning action to run when the object
+ * becomes phantom reachable.
+ * Refer to the API Note above for
+ * cautions about the behavior of cleaning actions.
+ *
+ * @param obj the object to monitor
+ * @param action a {@code Runnable} to invoke when the object becomes phantom reachable
+ * @return a {@code Cleanable} instance
+ */
+ public Cleanable register(Object obj, Runnable action) {
+ Objects.requireNonNull(obj, "obj");
+ Objects.requireNonNull(action, "action");
+ return new CleanerImpl.PhantomCleanableRef(obj, this, action);
+ }
+
+ /**
+ * {@code Cleanable} represents an object and a
+ * cleaning action registered in a {@code Cleaner}.
+ * @since 9
+ */
+ public interface Cleanable {
+ /**
+ * Unregisters the cleanable and invokes the cleaning action.
+ * The cleanable's cleaning action is invoked at most once
+ * regardless of the number of calls to {@code clean}.
+ */
+ void clean();
+ }
+
+}
diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
index 4c6653f815a..221d07e207b 100644
--- a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
@@ -29,7 +29,6 @@ import java.security.PrivilegedAction;
import java.security.AccessController;
import jdk.internal.misc.JavaLangAccess;
import jdk.internal.misc.SharedSecrets;
-import sun.misc.ManagedLocalsThread;
import sun.misc.VM;
final class Finalizer extends FinalReferencerun
method of this thread.
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java
index 13cf24ca0f2..df245e661e9 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java
@@ -83,7 +83,6 @@ private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String nam
*/
abstract
public class CallSite {
- static { MethodHandleImpl.initStatics(); }
// The actual payload of this call site:
/*package-private*/
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
index 6e8293e78a6..50e28e56cab 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java
@@ -1073,11 +1073,6 @@ import java.util.Objects;
}
}
-// static {
-// System.out.println("Hello world! My methods are:");
-// System.out.println(Factory.INSTANCE.getMethods(MemberName.class, true, null));
-// }
-
static {
// Allow privileged classes outside of java.lang
jdk.internal.misc.SharedSecrets.setJavaLangInvokeAccess(new jdk.internal.misc.JavaLangInvokeAccess() {
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
index 2db85563d71..a3f6f47b00f 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
@@ -420,7 +420,6 @@ mh.invokeExact(System.out, "Hello, world.");
* @author John Rose, JSR 292 EG
*/
public abstract class MethodHandle {
- static { MethodHandleImpl.initStatics(); }
/**
* Internal marker interface which distinguishes (to the Java compiler)
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
index 7ad49cd38aa..51d6b0665e2 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
@@ -32,7 +32,6 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.function.Function;
-import java.util.stream.Collectors;
import sun.invoke.empty.Empty;
import sun.invoke.util.ValueConversions;
@@ -65,11 +64,6 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
/// Factory methods to create method handles:
- static void initStatics() {
- // Trigger selected static initializations.
- MemberName.Factory.INSTANCE.getClass();
- }
-
static MethodHandle makeArrayElementAccessor(Class> arrayClass, boolean isSetter) {
if (arrayClass == Object[].class)
return (isSetter ? ArrayAccessor.OBJECT_ARRAY_SETTER : ArrayAccessor.OBJECT_ARRAY_GETTER);
@@ -700,33 +694,43 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
MethodHandle makeBlockInliningWrapper(MethodHandle target) {
LambdaForm lform;
if (DONT_INLINE_THRESHOLD > 0) {
- lform = PRODUCE_BLOCK_INLINING_FORM.apply(target);
+ lform = Makers.PRODUCE_BLOCK_INLINING_FORM.apply(target);
} else {
- lform = PRODUCE_REINVOKER_FORM.apply(target);
+ lform = Makers.PRODUCE_REINVOKER_FORM.apply(target);
}
return new CountingWrapper(target, lform,
- PRODUCE_BLOCK_INLINING_FORM, PRODUCE_REINVOKER_FORM,
+ Makers.PRODUCE_BLOCK_INLINING_FORM, Makers.PRODUCE_REINVOKER_FORM,
DONT_INLINE_THRESHOLD);
}
- /** Constructs reinvoker lambda form which block inlining during JIT-compilation for a particular method handle */
- private static final Function{@code
+ * public class CleaningExample implements AutoCloseable {
+ * // A cleaner, preferably one shared within a library
+ * private static final Cleaner cleaner =
+ * The cleaning action could be a lambda but all too easily will capture
+ * the object reference, by referring to fields of the object being cleaned,
+ * preventing the object from becoming phantom reachable.
+ * Using a static nested class, as above, will avoid accidentally retaining the
+ * object reference.
+ *