Skip to content

Commit 09d9889

Browse files
authored
Merge pull request #1941 from SAP/pr-jdk-25+15
Merge to tag jdk-25+15
2 parents 4c9d063 + 74df384 commit 09d9889

File tree

378 files changed

+11972
-7250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

378 files changed

+11972
-7250
lines changed

make/RunTests.gmk

+14-11
Original file line numberDiff line numberDiff line change
@@ -732,14 +732,16 @@ endef
732732
#
733733
SetupAOT = $(NamedParamsMacroTemplate)
734734
define SetupAOTBody
735-
$1_AOT_JDK_CONF := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotconf
736-
$1_AOT_JDK_CACHE := $$($1_TEST_SUPPORT_DIR)/aot/jdk.aotcache
737-
$1_AOT_JDK_LOG := $$($1_TEST_SUPPORT_DIR)/aot/TestSetupAOT.log
735+
$1_AOT_JDK_OUTPUT_DIR := $$($1_TEST_SUPPORT_DIR)/aot
736+
$1_AOT_JDK_CONF := $$($1_AOT_JDK_OUTPUT_DIR)/jdk.aotconf
737+
$1_AOT_JDK_CACHE := $$($1_AOT_JDK_OUTPUT_DIR)/jdk.aotcache
738+
$1_AOT_JDK_LOG := $$($1_AOT_JDK_OUTPUT_DIR)/TestSetupAOT.log
738739

739-
# We execute the training run with $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.class
740+
# We execute the training run with the TestSetupAOT class from $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar
740741
# to touch a fair number of classes inside the JDK. Note that we can't specify a classpath,
741742
# or else the AOT cache cannot be used with jtreg test cases that use a different value
742-
# for their classpaths. Instead, we run in the $(TEST_IMAGE_DIR)/setup_aot/ directory.
743+
# for their classpaths. Instead, we cd in the $$($1_AOT_JDK_OUTPUT_DIR) directory,
744+
# extract the TestSetupAOT.jar there, and run in that directory without specifying a classpath.
743745
# The "java" launcher will have an implicit classpath of ".", so it can pick up the TestSetupAOT
744746
# class from the JVM's current directory.
745747
#
@@ -748,19 +750,20 @@ define SetupAOTBody
748750
# only classes from the JDK.
749751

750752
$$($1_AOT_JDK_CACHE): $$(JDK_IMAGE_DIR)/release
751-
$$(call MakeDir, $$($1_TEST_SUPPORT_DIR)/aot)
753+
$$(call MakeDir, $$($1_AOT_JDK_OUTPUT_DIR))
752754

753755
$$(call LogWarn, AOT: Create cache configuration) \
754-
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot, ( \
755-
$(CD) $(TEST_IMAGE_DIR)/setup_aot; \
756+
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
757+
cd $$($1_AOT_JDK_OUTPUT_DIR); \
758+
$(JAR) --extract --file $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar; \
756759
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java $$($1_VM_OPTIONS) \
757-
-Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error \
760+
-Xlog:class+load,cds,cds+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error \
758761
-XX:AOTMode=record -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) \
759-
TestSetupAOT > $$($1_AOT_JDK_LOG) \
762+
TestSetupAOT $$($1_AOT_JDK_OUTPUT_DIR) > $$($1_AOT_JDK_LOG) \
760763
))
761764

762765
$$(call LogWarn, AOT: Generate AOT cache $$($1_AOT_JDK_CACHE) with flags: $$($1_VM_OPTIONS))
763-
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/aot, ( \
766+
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
764767
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java \
765768
$$($1_VM_OPTIONS) -Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error \
766769
-XX:ExtraSharedClassListFile=$(JDK_UNDER_TEST)/lib/classlist \

make/autoconf/libraries.m4

+14
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,20 @@ AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
205205
fi
206206
AC_SUBST(LIBPTHREAD)
207207
208+
# Setup libiconv flags and library
209+
if test "x$OPENJDK_TARGET_OS" == "xaix" || test "x$OPENJDK_TARGET_OS" == "xmacosx"; then
210+
ICONV_CFLAGS=
211+
ICONV_LDFLAGS=
212+
ICONV_LIBS=-liconv
213+
else
214+
ICONV_CFLAGS=
215+
ICONV_LDFLAGS=
216+
ICONV_LIBS=
217+
fi
218+
AC_SUBST(ICONV_CFLAGS)
219+
AC_SUBST(ICONV_LDFLAGS)
220+
AC_SUBST(ICONV_LIBS)
221+
208222
# Control if libzip can use mmap. Available for purposes of overriding.
209223
LIBZIP_CAN_USE_MMAP=true
210224
AC_SUBST(LIBZIP_CAN_USE_MMAP)

make/autoconf/spec.gmk.template

+3
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ LIBFFI_LIBS := @LIBFFI_LIBS@
427427
LIBFFI_CFLAGS := @LIBFFI_CFLAGS@
428428
ENABLE_LIBFFI_BUNDLING := @ENABLE_LIBFFI_BUNDLING@
429429
LIBFFI_LIB_FILE := @LIBFFI_LIB_FILE@
430+
ICONV_CFLAGS := @ICONV_CFLAGS@
431+
ICONV_LDFLAGS := @ICONV_LDFLAGS@
432+
ICONV_LIBS := @ICONV_LIBS@
430433
FILE_MACRO_CFLAGS := @FILE_MACRO_CFLAGS@
431434
REPRODUCIBLE_CFLAGS := @REPRODUCIBLE_CFLAGS@
432435

make/modules/java.base/lib/CoreLibraries.gmk

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,9 @@ ifeq ($(INCLUDE), true)
3232
## Build libverify
3333
################################################################################
3434

35-
LIBVERIFY_OPTIMIZATION := HIGH
36-
ifeq ($(call isTargetOs, linux)+$(COMPILE_WITH_DEBUG_SYMBOLS), true+true)
37-
LIBVERIFY_OPTIMIZATION := LOW
38-
endif
39-
4035
$(eval $(call SetupJdkLibrary, BUILD_LIBVERIFY, \
4136
NAME := verify, \
42-
OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
37+
OPTIMIZATION := HIGH, \
4338
DISABLED_WARNINGS_gcc_check_code.c := unused-variable, \
4439
DISABLED_WARNINGS_clang_check_code.c := unused-variable, \
4540
EXTRA_HEADER_DIRS := libjava, \

make/modules/java.desktop/lib/ClientLibraries.gmk

+10-6
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,16 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
228228
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
229229
OPTIMIZATION := SIZE, \
230230
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
231-
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
231+
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS) \
232+
$(ICONV_CFLAGS), \
232233
CXXFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
233-
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS), \
234+
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS) \
235+
$(ICONV_CFLAGS), \
234236
EXTRA_HEADER_DIRS := $(LIBSPLASHSCREEN_HEADER_DIRS), \
235237
DISABLED_WARNINGS_gcc_dgif_lib.c := sign-compare, \
236238
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
237239
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
238-
DISABLED_WARNINGS_gcc_png.c := maybe-uninitialized, \
240+
DISABLED_WARNINGS_gcc_png.c := maybe-uninitialized unused-function, \
239241
DISABLED_WARNINGS_gcc_pngerror.c := maybe-uninitialized, \
240242
DISABLED_WARNINGS_gcc_splashscreen_gfx_impl.c := implicit-fallthrough \
241243
maybe-uninitialized, \
@@ -246,6 +248,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
246248
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
247249
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
248250
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
251+
DISABLED_WARNINGS_clang_png.c := unused-function, \
249252
DISABLED_WARNINGS_clang_splashscreen_impl.c := sign-compare \
250253
unused-but-set-variable unused-function, \
251254
DISABLED_WARNINGS_clang_splashscreen_png.c := \
@@ -256,19 +259,20 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
256259
DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \
257260
DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \
258261
DISABLED_WARNINGS_microsoft_splashscreen_sys.c := 4267 4244, \
262+
LDFLAGS := $(ICONV_LDFLAGS), \
259263
LDFLAGS_windows := -delayload:user32.dll, \
260264
JDK_LIBS_windows := java.base:libjava, \
261265
JDK_LIBS_macosx := libosxapp, \
262-
LIBS := $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(LIBZ_LIBS) $(PNG_LIBS), \
266+
LIBS := $(GIFLIB_LIBS) $(LIBJPEG_LIBS) $(LIBZ_LIBS) $(PNG_LIBS) $(ICONV_LIBS), \
263267
LIBS_unix := $(LIBM) $(LIBPTHREAD), \
264268
LIBS_linux := $(LIBDL) $(X_LIBS) -lX11 -lXext, \
265-
LIBS_macosx := -liconv \
269+
LIBS_macosx := \
266270
-framework ApplicationServices \
267271
-framework Cocoa \
268272
-framework Foundation \
269273
-framework Metal \
270274
-framework Security, \
271-
LIBS_aix := $(LIBDL) -liconv $(X_LIBS) -lX11 -lXext, \
275+
LIBS_aix := $(LIBDL) $(X_LIBS) -lX11 -lXext, \
272276
LIBS_windows := delayimp.lib gdi32.lib kernel32.lib user32.lib, \
273277
STATIC_LIB_EXCLUDE_OBJS := $(LIBSPLASHSCREEN_STATIC_LIB_EXCLUDE_OBJS), \
274278
))

make/modules/java.instrument/Lib.gmk

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@ include LibCommon.gmk
3535
$(eval $(call SetupJdkLibrary, BUILD_LIBINSTRUMENT, \
3636
NAME := instrument, \
3737
OPTIMIZATION := LOW, \
38+
CFLAGS := $(ICONV_CFLAGS), \
3839
CFLAGS_windows := -Dstrcasecmp=stricmp, \
3940
CFLAGS_debug := -DJPLIS_LOGGING, \
4041
CFLAGS_release := -DNO_JPLIS_LOGGING, \
42+
LDFLAGS := $(ICONV_LDFLAGS), \
4143
JDK_LIBS := java.base:libjava java.base:libjli java.base:libjvm, \
44+
LIBS := $(ICONV_LIBS), \
4245
LIBS_unix := $(LIBZ_LIBS), \
4346
LIBS_linux := $(LIBDL), \
44-
LIBS_aix := $(LIBDL) -liconv, \
45-
LIBS_macosx := -liconv \
47+
LIBS_aix := $(LIBDL), \
48+
LIBS_macosx := \
4649
-framework ApplicationServices \
4750
-framework Cocoa \
4851
-framework Security, \

make/modules/java.management/Lib.gmk

+1-8
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,9 @@ include LibCommon.gmk
3131
## Build libmanagement
3232
################################################################################
3333

34-
LIBMANAGEMENT_OPTIMIZATION := HIGH
35-
ifeq ($(call isTargetOs, linux)+$(COMPILE_WITH_DEBUG_SYMBOLS), true+true)
36-
LIBMANAGEMENT_OPTIMIZATION := LOW
37-
endif
38-
3934
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
4035
NAME := management, \
41-
OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
42-
DISABLED_WARNINGS_gcc_VMManagementImpl.c := unused-variable, \
43-
DISABLED_WARNINGS_clang_VMManagementImpl.c := unused-variable, \
36+
OPTIMIZATION := HIGH, \
4437
JDK_LIBS := java.base:libjava java.base:libjvm, \
4538
LIBS_aix := -lperfstat, \
4639
LIBS_windows := advapi32.lib psapi.lib, \

make/modules/jdk.jdwp.agent/Lib.gmk

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ TARGETS += $(BUILD_LIBDT_FILESOCKET)
6969
$(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
7070
NAME := jdwp, \
7171
OPTIMIZATION := LOW, \
72-
CFLAGS := -DJDWP_LOGGING, \
72+
CFLAGS := -DJDWP_LOGGING $(ICONV_CFLAGS), \
7373
DISABLED_WARNINGS_gcc_eventFilter.c := unused-variable, \
7474
DISABLED_WARNINGS_gcc_SDE.c := unused-function, \
7575
DISABLED_WARNINGS_gcc_threadControl.c := unused-but-set-variable \
@@ -84,14 +84,14 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
8484
DISABLED_WARNINGS_clang_threadControl.c := unused-but-set-variable \
8585
unused-variable, \
8686
DISABLED_WARNINGS_clang_utf_util.c := unused-but-set-variable, \
87+
LDFLAGS := $(ICONV_LDFLAGS), \
8788
EXTRA_HEADER_DIRS := \
8889
include \
8990
libjdwp/export \
9091
java.base:libjava, \
9192
JDK_LIBS := java.base:libjvm, \
93+
LIBS := $(ICONV_LIBS), \
9294
LIBS_linux := $(LIBDL), \
93-
LIBS_macosx := -liconv, \
94-
LIBS_aix := -liconv, \
9595
))
9696

9797
TARGETS += $(BUILD_LIBJDWP)

make/modules/jdk.management/Lib.gmk

+1-6
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,9 @@ ifeq ($(call isTargetOs, windows), true)
3838
LIBMANAGEMENT_EXT_CFLAGS := -DPSAPI_VERSION=1
3939
endif
4040

41-
LIBMANAGEMENT_EXT_OPTIMIZATION := HIGH
42-
ifeq ($(call isTargetOs, linux)+$(COMPILE_WITH_DEBUG_SYMBOLS), true+true)
43-
LIBMANAGEMENT_EXT_OPTIMIZATION := LOW
44-
endif
45-
4641
$(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT_EXT, \
4742
NAME := management_ext, \
48-
OPTIMIZATION := $(LIBMANAGEMENT_EXT_OPTIMIZATION), \
43+
OPTIMIZATION := HIGH, \
4944
DISABLED_WARNINGS_gcc_DiagnosticCommandImpl.c := unused-variable, \
5045
DISABLED_WARNINGS_clang_DiagnosticCommandImpl.c := unused-variable, \
5146
DISABLED_WARNINGS_clang_UnixOperatingSystem.c := format-nonliteral, \

make/test/BuildTestSetupAOT.gmk

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ include JavaCompilation.gmk
3737

3838
SETUP_AOT_BASEDIR := $(TOPDIR)/test/setup_aot
3939
SETUP_AOT_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/setup_aot
40-
SETUP_AOT_CLASS := $(SETUP_AOT_SUPPORT)/classes/TestSetupAOT.class
40+
SETUP_AOT_JAR := $(SETUP_AOT_SUPPORT)/TestSetupAOT.jar
4141

4242
$(eval $(call SetupJavaCompilation, BUILD_SETUP_AOT, \
4343
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
4444
SRC := $(SETUP_AOT_BASEDIR), \
4545
BIN := $(SETUP_AOT_SUPPORT)/classes, \
46+
JAR := $(SETUP_AOT_JAR), \
4647
))
4748

4849
TARGETS += $(BUILD_SETUP_AOT)
@@ -53,9 +54,8 @@ TARGETS += $(BUILD_SETUP_AOT)
5354

5455
# Copy to hotspot jtreg test image
5556
$(eval $(call SetupCopyFiles, COPY_SETUP_AOT, \
56-
SRC := $(SETUP_AOT_SUPPORT)/classes, \
5757
DEST := $(TEST_IMAGE_DIR)/setup_aot, \
58-
FILES := TestSetupAOT.class, \
58+
FILES := $(SETUP_AOT_JAR), \
5959
))
6060

6161
IMAGES_TARGETS += $(COPY_SETUP_AOT)

src/hotspot/cpu/aarch64/register_aarch64.cpp

+20
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,23 @@ const char* PRegister::PRegisterImpl::name() const {
5858
};
5959
return is_valid() ? names[encoding()] : "pnoreg";
6060
}
61+
62+
// convenience methods for splitting 8-way vector register sequences
63+
// in half -- needed because vector operations can normally only be
64+
// benefit from 4-way instruction parallelism
65+
66+
VSeq<4> vs_front(const VSeq<8>& v) {
67+
return VSeq<4>(v.base(), v.delta());
68+
}
69+
70+
VSeq<4> vs_back(const VSeq<8>& v) {
71+
return VSeq<4>(v.base() + 4 * v.delta(), v.delta());
72+
}
73+
74+
VSeq<4> vs_even(const VSeq<8>& v) {
75+
return VSeq<4>(v.base(), v.delta() * 2);
76+
}
77+
78+
VSeq<4> vs_odd(const VSeq<8>& v) {
79+
return VSeq<4>(v.base() + 1, v.delta() * 2);
80+
}

src/hotspot/cpu/aarch64/register_aarch64.hpp

+68
Original file line numberDiff line numberDiff line change
@@ -412,4 +412,72 @@ inline Register as_Register(FloatRegister reg) {
412412
// High-level register class of an OptoReg or a VMReg register.
413413
enum RC { rc_bad, rc_int, rc_float, rc_predicate, rc_stack };
414414

415+
// AArch64 Vector Register Sequence management support
416+
//
417+
// VSeq implements an indexable (by operator[]) vector register
418+
// sequence starting from a fixed base register and with a fixed delta
419+
// (defaulted to 1, but sometimes 0 or 2) e.g. VSeq<4>(16) will return
420+
// registers v16, ... v19 for indices 0, ... 3.
421+
//
422+
// Generator methods may iterate across sets of VSeq<4> to schedule an
423+
// operation 4 times using distinct input and output registers,
424+
// profiting from 4-way instruction parallelism.
425+
//
426+
// A VSeq<2> can be used to specify registers loaded with special
427+
// constants e.g. <v30, v31> --> <MONT_Q, MONT_Q_INV_MOD_R>.
428+
//
429+
// A VSeq with base n and delta 0 can be used to generate code that
430+
// combines values in another VSeq with the constant in register vn.
431+
//
432+
// A VSeq with base n and delta 2 can be used to select an odd or even
433+
// indexed set of registers.
434+
//
435+
// Methods which accept arguments of type VSeq<8>, may split their
436+
// inputs into front and back halves or odd and even halves (see
437+
// convenience methods below).
438+
439+
template<int N> class VSeq {
440+
static_assert(N >= 2, "vector sequence length must be greater than 1");
441+
static_assert(N <= 8, "vector sequence length must not exceed 8");
442+
static_assert((N & (N - 1)) == 0, "vector sequence length must be power of two");
443+
private:
444+
int _base; // index of first register in sequence
445+
int _delta; // increment to derive successive indices
446+
public:
447+
VSeq(FloatRegister base_reg, int delta = 1) : VSeq(base_reg->encoding(), delta) { }
448+
VSeq(int base, int delta = 1) : _base(base), _delta(delta) {
449+
assert (_base >= 0, "invalid base register");
450+
assert (_delta >= 0, "invalid register delta");
451+
assert ((_base + (N - 1) * _delta) < 32, "range exceeded");
452+
}
453+
// indexed access to sequence
454+
FloatRegister operator [](int i) const {
455+
assert (0 <= i && i < N, "index out of bounds");
456+
return as_FloatRegister(_base + i * _delta);
457+
}
458+
int mask() const {
459+
int m = 0;
460+
int bit = 1 << _base;
461+
for (int i = 0; i < N; i++) {
462+
m |= bit << (i * _delta);
463+
}
464+
return m;
465+
}
466+
int base() const { return _base; }
467+
int delta() const { return _delta; }
468+
};
469+
470+
// declare convenience methods for splitting vector register sequences
471+
472+
VSeq<4> vs_front(const VSeq<8>& v);
473+
VSeq<4> vs_back(const VSeq<8>& v);
474+
VSeq<4> vs_even(const VSeq<8>& v);
475+
VSeq<4> vs_odd(const VSeq<8>& v);
476+
477+
// methods for use in asserts to check VSeq inputs and oupts are
478+
// either disjoint or equal
479+
480+
template<int N, int M> bool vs_disjoint(const VSeq<N>& n, const VSeq<M>& m) { return (n.mask() & m.mask()) == 0; }
481+
template<int N> bool vs_same(const VSeq<N>& n, const VSeq<N>& m) { return n.mask() == m.mask(); }
482+
415483
#endif // CPU_AARCH64_REGISTER_AARCH64_HPP

0 commit comments

Comments
 (0)