Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/openjdk/jdk into fix/type…
Browse files Browse the repository at this point in the history
…kind
  • Loading branch information
liach committed Aug 29, 2024
2 parents 41f81fe + b711c41 commit 6a26b78
Show file tree
Hide file tree
Showing 72 changed files with 2,402 additions and 437 deletions.
8 changes: 4 additions & 4 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
# Additional warnings that are not activated by -Wall and -Wextra
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare \
-Wunused-function -Wundef -Wunused-value -Wreturn-type \
-Wtrampolines"
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wreturn-type -Wsign-compare \
-Wtrampolines -Wundef -Wunused-const-variable=1 -Wunused-function \
-Wunused-result -Wunused-value"
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
DISABLED_WARNINGS="unused-parameter unused"
DISABLED_WARNINGS="unused-parameter"
# gcc10/11 on ppc generate lots of abi warnings about layout of aggregates containing vectors
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xppc"; then
DISABLED_WARNINGS="$DISABLED_WARNINGS psabi"
Expand Down
4 changes: 3 additions & 1 deletion make/common/TestFilesCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ define SetupTestFilesCompilationBody
CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \
LDFLAGS := $$($1_LDFLAGS_$$(name)), \
DISABLED_WARNINGS_gcc := format undef unused-function unused-value, \
DISABLED_WARNINGS_gcc := format undef unused-but-set-variable \
unused-const-variable unused-function unused-value \
unused-variable, \
DISABLED_WARNINGS_clang := undef format-nonliteral \
missing-field-initializers sometimes-uninitialized, \
DEFAULT_LIBCXX := false, \
Expand Down
2 changes: 1 addition & 1 deletion make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ define SetupBuildLauncherBody
$$($1_CFLAGS), \
CFLAGS_windows := $$($1_CFLAGS_windows), \
EXTRA_HEADER_DIRS := java.base:libjvm, \
DISABLED_WARNINGS_gcc := unused-function, \
DISABLED_WARNINGS_gcc := unused-function unused-variable, \
LDFLAGS := $$($1_LDFLAGS), \
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
Expand Down
7 changes: 4 additions & 3 deletions make/hotspot/lib/CompileGtest.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
$(GTEST_FRAMEWORK_SRC)/googletest/src \
$(GTEST_FRAMEWORK_SRC)/googlemock/src, \
INCLUDE_FILES := gtest-all.cc gmock-all.cc, \
DISABLED_WARNINGS_gcc := undef unused-result format-nonliteral \
maybe-uninitialized zero-as-null-pointer-constant, \
DISABLED_WARNINGS_clang := undef unused-result format-nonliteral, \
DISABLED_WARNINGS_gcc := format-nonliteral maybe-uninitialized undef \
unused-result zero-as-null-pointer-constant, \
DISABLED_WARNINGS_clang := format-nonliteral undef unused-result, \
DEFAULT_CFLAGS := false, \
CFLAGS := $(JVM_CFLAGS) \
-I$(GTEST_FRAMEWORK_SRC)/googletest \
Expand Down Expand Up @@ -100,6 +100,7 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
CFLAGS_macosx := -DGTEST_OS_MAC=1, \
DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc) \
undef stringop-overflow, \
DISABLED_WARNINGS_gcc_test_metaspace_misc.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_test_threadCpuLoad.cpp := address, \
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang) \
undef switch format-nonliteral tautological-undefined-compare \
Expand Down
15 changes: 14 additions & 1 deletion make/hotspot/lib/CompileJvm.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ CFLAGS_VM_VERSION := \
DISABLED_WARNINGS_gcc := array-bounds comment delete-non-virtual-dtor \
empty-body implicit-fallthrough int-in-bool-context \
maybe-uninitialized missing-field-initializers \
shift-negative-value unknown-pragmas
shift-negative-value unknown-pragmas unused-but-set-variable \
unused-local-typedefs unused-variable

DISABLED_WARNINGS_clang := sometimes-uninitialized \
missing-braces delete-non-abstract-non-virtual-dtor unknown-pragmas
Expand Down Expand Up @@ -177,15 +178,27 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc), \
DISABLED_WARNINGS_gcc_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp := nonnull, \
DISABLED_WARNINGS_gcc_bytecodeInterpreter.cpp := unused-label, \
DISABLED_WARNINGS_gcc_c1_Runtime1_aarch64.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_cgroupV1Subsystem_linux.cpp := address, \
DISABLED_WARNINGS_gcc_cgroupV2Subsystem_linux.cpp := address, \
DISABLED_WARNINGS_gcc_g1FreeIdSet.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_handshake.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_interp_masm_x86.cpp := uninitialized, \
DISABLED_WARNINGS_gcc_javaClasses.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jfrChunkWriter.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jfrMemorySizer.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jfrTraceIdKlassQueue.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jvmciCodeInstaller.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_jvmFlag.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jvmtiTagMap.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_macroAssembler_ppc_sha.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
DISABLED_WARNINGS_gcc_shenandoahLock.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_stubGenerator_s390.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_synchronizer.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_templateInterpreterGenerator_x86.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_xGlobals_ppc.cpp := unused-const-variable, \
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang), \
DISABLED_WARNINGS_clang_arguments.cpp := missing-field-initializers, \
DISABLED_WARNINGS_clang_codeBuffer.cpp := tautological-undefined-compare, \
Expand Down
5 changes: 4 additions & 1 deletion make/modules/java.base/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ include lib/CoreLibraries.gmk
$(eval $(call SetupJdkLibrary, BUILD_LIBNET, \
NAME := net, \
OPTIMIZATION := LOW, \
DISABLED_WARNINGS_gcc_net_util_md.c := format-nonliteral, \
DISABLED_WARNINGS_gcc_net_util_md.c := format-nonliteral unused-variable, \
DISABLED_WARNINGS_gcc_NetworkInterface.c := unused-function, \
DISABLED_WARNINGS_clang_net_util_md.c := format-nonliteral, \
DISABLED_WARNINGS_clang_aix_DefaultProxySelector.c := \
Expand Down Expand Up @@ -116,6 +116,7 @@ ifeq ($(call isTargetOsType, unix), true)
NAME := jsig, \
OPTIMIZATION := LOW, \
jsig.c_CFLAGS := -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"', \
DISABLED_WARNINGS_gcc_jsig.c := unused-but-set-variable, \
LIBS_linux := $(LIBDL), \
LIBS_aix := $(LIBDL), \
))
Expand Down Expand Up @@ -169,6 +170,7 @@ ifeq ($(ENABLE_FALLBACK_LINKER), true)
NAME := fallbackLinker, \
EXTRA_HEADER_DIRS := java.base:libjava, \
CFLAGS := $(LIBFFI_CFLAGS), \
DISABLED_WARNINGS_gcc := implicit-function-declaration unused-variable, \
LIBS := $(LIBFFI_LIBS), \
LIBS_windows := ws2_32.lib, \
))
Expand All @@ -186,6 +188,7 @@ ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2)
LINK_TYPE := C++, \
OPTIMIZATION := HIGH, \
CXXFLAGS := -std=c++17, \
DISABLED_WARNINGS_gcc := unused-variable, \
LIBS_linux := $(LIBDL) $(LIBM), \
))

Expand Down
6 changes: 5 additions & 1 deletion make/modules/java.base/lib/CoreLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
NAME := verify, \
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
DISABLED_WARNINGS_gcc_check_code.c := unused-variable, \
EXTRA_HEADER_DIRS := libjava, \
JDK_LIBS := libjvm, \
))
Expand Down Expand Up @@ -108,6 +109,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJIMAGE, \
OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := libjava, \
CFLAGS_unix := -UDEBUG, \
DISABLED_WARNINGS_gcc_imageDecompressor.cpp := unused-variable, \
DISABLED_WARNINGS_gcc_imageFile.cpp := unused-const-variable \
unused-variable, \
LDFLAGS := $(LDFLAGS_CXX_JDK), \
JDK_LIBS := libjvm, \
LIBS_unix := $(LIBDL), \
Expand Down Expand Up @@ -167,7 +171,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJLI, \
EXTRA_HEADER_DIRS := libjvm, \
OPTIMIZATION := HIGH, \
CFLAGS := $(LIBJLI_CFLAGS) $(LIBZ_CFLAGS), \
DISABLED_WARNINGS_gcc := unused-function, \
DISABLED_WARNINGS_gcc := unused-function unused-variable, \
DISABLED_WARNINGS_clang := format-nonliteral deprecated-non-prototype, \
LIBS_unix := $(LIBZ_LIBS), \
LIBS_linux := $(LIBDL) -lpthread, \
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.desktop/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ifeq ($(call isTargetOs, aix), false)
EXTRA_HEADER_DIRS := java.base:libjava, \
CFLAGS := $(LIBJSOUND_CFLAGS), \
CXXFLAGS := $(LIBJSOUND_CFLAGS), \
DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_gcc := undef unused-variable, \
DISABLED_WARNINGS_clang := undef, \
LIBS_linux := $(ALSA_LIBS), \
LIBS_macosx := \
Expand Down
8 changes: 6 additions & 2 deletions make/modules/java.desktop/lib/AwtLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBAWT, \
CXXFLAGS := $(LIBAWT_CFLAGS) $(X_CFLAGS), \
CFLAGS_gcc := -fgcse-after-reload, \
EXTRA_HEADER_DIRS := $(LIBAWT_EXTRA_HEADER_DIRS), \
DISABLED_WARNINGS_gcc := unused-but-set-variable unused-variable, \
DISABLED_WARNINGS_gcc_awt_LoadLibrary.c := unused-result, \
DISABLED_WARNINGS_gcc_debug_mem.c := format-nonliteral, \
DISABLED_WARNINGS_gcc_ProcessPath.c := maybe-uninitialized, \
Expand Down Expand Up @@ -178,6 +179,7 @@ ifeq ($(call isTargetOs, windows macosx), false)
CFLAGS := -DHEADLESS=true $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) \
$(X_CFLAGS), \
EXTRA_HEADER_DIRS := $(LIBAWT_HEADLESS_EXTRA_HEADER_DIRS), \
DISABLED_WARNINGS_gcc := unused-variable, \
DISABLED_WARNINGS_gcc_X11Renderer.c := unused-function, \
DISABLED_WARNINGS_gcc_X11SurfaceData.c := unused-function, \
JDK_LIBS := libawt java.base:libjava, \
Expand Down Expand Up @@ -234,7 +236,7 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
OPTIMIZATION := LOW, \
CFLAGS := -DXAWT -DXAWT_HACK $(LIBAWT_XAWT_CFLAGS) \
$(FONTCONFIG_CFLAGS) $(CUPS_CFLAGS) $(X_CFLAGS), \
DISABLED_WARNINGS_gcc := int-to-pointer-cast, \
DISABLED_WARNINGS_gcc := int-to-pointer-cast unused-variable, \
DISABLED_WARNINGS_gcc_awt_Taskbar.c := parentheses, \
DISABLED_WARNINGS_gcc_GLXSurfaceData.c := unused-function, \
DISABLED_WARNINGS_gcc_gtk3_interface.c := parentheses type-limits \
Expand All @@ -244,8 +246,10 @@ ifeq ($(call isTargetOs, windows macosx)+$(ENABLE_HEADLESS_ONLY), false+false)
DISABLED_WARNINGS_gcc_screencast_pipewire.c := undef, \
DISABLED_WARNINGS_gcc_screencast_portal.c := undef, \
DISABLED_WARNINGS_gcc_sun_awt_X11_GtkFileDialogPeer.c := parentheses, \
DISABLED_WARNINGS_gcc_X11Color.c := unused-but-set-variable, \
DISABLED_WARNINGS_gcc_X11SurfaceData.c := implicit-fallthrough \
pointer-to-int-cast, \
pointer-to-int-cast unused-but-set-variable, \
DISABLED_WARNINGS_gcc_X11TextRenderer_md.c := unused-but-set-variable, \
DISABLED_WARNINGS_gcc_XlibWrapper.c := type-limits pointer-to-int-cast, \
DISABLED_WARNINGS_gcc_XRBackendNative.c := maybe-uninitialized, \
DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \
Expand Down
13 changes: 8 additions & 5 deletions make/modules/java.desktop/lib/ClientLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBLCMS, \
libawt/java2d \
java.base:libjvm, \
HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \
DISABLED_WARNINGS_gcc := format-nonliteral type-limits \
stringop-truncation, \
DISABLED_WARNINGS_gcc := format-nonliteral stringop-truncation type-limits \
unused-variable, \
DISABLED_WARNINGS_clang := format-nonliteral, \
JDK_LIBS := libawt java.base:libjava, \
LIBS_unix := $(LCMS_LIBS) $(LIBM), \
Expand Down Expand Up @@ -118,7 +118,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJAVAJPEG, \
INCLUDE_FILES := $(LIBJAVAJPEG_INCLUDE_FILES), \
OPTIMIZATION := HIGHEST, \
HEADERS_FROM_SRC := $(LIBJAVAJPEG_HEADERS_FROM_SRC), \
DISABLED_WARNINGS_gcc_imageioJPEG.c := clobbered array-bounds, \
DISABLED_WARNINGS_gcc_imageioJPEG.c := array-bounds clobbered \
unused-but-set-variable, \
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
JDK_LIBS := java.base:libjava, \
Expand Down Expand Up @@ -224,7 +225,8 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
maybe-uninitialized, \
DISABLED_WARNINGS_gcc_splashscreen_impl.c := implicit-fallthrough \
sign-compare unused-function, \
DISABLED_WARNINGS_gcc_splashscreen_sys.c := type-limits unused-result, \
DISABLED_WARNINGS_gcc_splashscreen_sys.c := type-limits \
unused-but-set-variable unused-result unused-variable, \
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
Expand Down Expand Up @@ -309,7 +311,8 @@ else
# range-loop-analysis -> clang on Xcode12

HARFBUZZ_DISABLED_WARNINGS_gcc := missing-field-initializers \
strict-aliasing unused-result array-bounds parentheses
strict-aliasing unused-result array-bounds parentheses \
unused-variable
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
# maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+.
Expand Down
1 change: 1 addition & 0 deletions make/modules/java.management/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
NAME := management, \
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
DISABLED_WARNINGS_gcc_VMManagementImpl.c := unused-variable, \
JDK_LIBS := java.base:libjava java.base:libjvm, \
LIBS_aix := -lperfstat,\
LIBS_windows := advapi32.lib psapi.lib, \
Expand Down
2 changes: 1 addition & 1 deletion make/modules/java.security.jgss/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2GSS, \
NAME := j2gss, \
OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
DISABLED_WARNINGS_gcc := undef, \
DISABLED_WARNINGS_gcc := undef unused-but-set-variable, \
DISABLED_WARNINGS_clang := undef, \
LIBS_unix := $(LIBDL), \
))
Expand Down
1 change: 1 addition & 0 deletions make/modules/jdk.crypto.cryptoki/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PKCS11, \
NAME := j2pkcs11, \
OPTIMIZATION := LOW, \
EXTRA_HEADER_DIRS := java.base:libjava, \
DISABLED_WARNINGS_gcc_p11_md.c := unused-variable, \
DISABLED_WARNINGS_clang_p11_util.c := format-nonliteral, \
LIBS_unix := $(LIBDL), \
))
Expand Down
4 changes: 3 additions & 1 deletion make/modules/jdk.hotspot.agent/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
OPTIMIZATION := HIGH, \
EXTRA_HEADER_DIRS := java.base:libjvm, \
DISABLED_WARNINGS_gcc := sign-compare, \
DISABLED_WARNINGS_gcc_LinuxDebuggerLocal.cpp := unused-variable, \
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \
DISABLED_WARNINGS_clang_ps_core.c := pointer-arith, \
DISABLED_WARNINGS_gcc_symtab.c := unused-but-set-variable, \
DISABLED_WARNINGS_clang := sign-compare, \
DISABLED_WARNINGS_clang_libproc_impl.c := format-nonliteral, \
DISABLED_WARNINGS_clang_ps_core.c := pointer-arith, \
DISABLED_WARNINGS_clang_sadis.c := format-nonliteral, \
CFLAGS := $(LIBSAPROC_CFLAGS), \
CXXFLAGS := $(LIBSAPROC_CFLAGS) $(LIBSAPROC_CXXFLAGS), \
Expand Down
3 changes: 3 additions & 0 deletions make/modules/jdk.jdwp.agent/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
NAME := jdwp, \
OPTIMIZATION := LOW, \
CFLAGS := -DJDWP_LOGGING, \
DISABLED_WARNINGS_gcc_eventFilter.c := unused-variable, \
DISABLED_WARNINGS_gcc_SDE.c := unused-function, \
DISABLED_WARNINGS_gcc_threadControl.c := unused-but-set-variable unused-variable, \
DISABLED_WARNINGS_gcc_utf_util.c := unused-but-set-variable, \
DISABLED_WARNINGS_clang_error_messages.c := format-nonliteral, \
DISABLED_WARNINGS_clang_EventRequestImpl.c := self-assign, \
DISABLED_WARNINGS_clang_inStream.c := sometimes-uninitialized, \
Expand Down
1 change: 1 addition & 0 deletions make/modules/jdk.jpackage/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ ifeq ($(call isTargetOs, linux), true)
EXCLUDE_FILES := LinuxLauncher.c LinuxPackage.c, \
LINK_TYPE := C++, \
OPTIMIZATION := LOW, \
DISABLED_WARNINGS_gcc_Log.cpp := unused-const-variable, \
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
DISABLED_WARNINGS_clang_tstrings.cpp := format-nonliteral, \
LD_SET_ORIGIN := false, \
Expand Down
1 change: 1 addition & 0 deletions make/modules/jdk.management/Lib.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ endif
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \
NAME := management_ext, \
OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
DISABLED_WARNINGS_gcc_DiagnosticCommandImpl.c := unused-variable, \
DISABLED_WARNINGS_clang_UnixOperatingSystem.c := format-nonliteral, \
CFLAGS := $(LIBMANAGEMENT_EXT_CFLAGS), \
JDK_LIBS := java.base:libjava java.base:libjvm, \
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/c1/c1_GraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
}

if (cha_monomorphic_target != nullptr) {
assert(!target->can_be_statically_bound() || target == cha_monomorphic_target, "");
assert(!target->can_be_statically_bound() || target->equals(cha_monomorphic_target), "");
assert(!cha_monomorphic_target->is_abstract(), "");
if (!cha_monomorphic_target->can_be_statically_bound(actual_recv)) {
// If we inlined because CHA revealed only a single target method,
Expand Down
24 changes: 0 additions & 24 deletions src/hotspot/share/cds/heapShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1644,30 +1644,6 @@ class FindEmbeddedNonNullPointers: public BasicOopIterateClosure {
};
#endif

#ifndef PRODUCT
ResourceBitMap HeapShared::calculate_oopmap(MemRegion region) {
size_t num_bits = region.byte_size() / (UseCompressedOops ? sizeof(narrowOop) : sizeof(oop));
ResourceBitMap oopmap(num_bits);

HeapWord* p = region.start();
HeapWord* end = region.end();
FindEmbeddedNonNullPointers finder((void*)p, &oopmap);

int num_objs = 0;
while (p < end) {
oop o = cast_to_oop(p);
o->oop_iterate(&finder);
p += o->size();
++ num_objs;
}

log_info(cds, heap)("calculate_oopmap: objects = %6d, oop fields = %7d (nulls = %7d)",
num_objs, finder.num_total_oops(), finder.num_null_oops());
return oopmap;
}

#endif // !PRODUCT

void HeapShared::count_allocation(size_t size) {
_total_obj_count ++;
_total_obj_size += size;
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/cds/heapShared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,6 @@ class HeapShared: AllStatic {
KlassSubGraphInfo* subgraph_info,
oop orig_obj);

#ifndef PRODUCT
static ResourceBitMap calculate_oopmap(MemRegion region); // marks all the oop pointers
#endif
static void add_to_dumped_interned_strings(oop string);

// Scratch objects for archiving Klass::java_mirror()
Expand Down
16 changes: 16 additions & 0 deletions src/hotspot/share/ci/ciMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,22 @@ bool ciMethod::can_omit_stack_trace() const {
return _can_omit_stack_trace;
}

// ------------------------------------------------------------------
// ciMethod::equals
//
// Returns true if the methods are the same, taking redefined methods
// into account.
bool ciMethod::equals(const ciMethod* m) const {
if (this == m) return true;
VM_ENTRY_MARK;
Method* m1 = this->get_Method();
Method* m2 = m->get_Method();
if (m1->is_old()) m1 = m1->get_new_method();
if (m2->is_old()) m2 = m2->get_new_method();
return m1 == m2;
}


// ------------------------------------------------------------------
// ciMethod::resolve_invoke
//
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/ci/ciMethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ class ciMethod : public ciMetadata {

bool can_omit_stack_trace() const;

bool equals(const ciMethod* m) const;

// Replay data methods
static void dump_name_as_ascii(outputStream* st, Method* method);
void dump_name_as_ascii(outputStream* st);
Expand Down
Loading

0 comments on commit 6a26b78

Please sign in to comment.