Skip to content

Commit 7a0b213

Browse files
authored
Merge pull request #2220 from SAP/pr-jdk-27+18
Merge to tag jdk-27+18
2 parents e1991f5 + 915c4ec commit 7a0b213

826 files changed

Lines changed: 18191 additions & 19458 deletions

File tree

Some content is hidden

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

bin/idea.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,18 @@ fi
187187
SOURCE_PREFIX="<sourceFolder url=\"file://"
188188
SOURCE_POSTFIX="\" isTestSource=\"false\" />"
189189

190+
# SOURCES is a single string containing embeded newlines.
190191
for root in $MODULE_ROOTS; do
191192
if [ "x$CYGPATH" != "x" ]; then
192193
root=`$CYGPATH -am $root`
193194
elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
194195
root=`wslpath -am $root`
195196
fi
196-
197-
SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
197+
# Add line termination/indentation for everything after the first entry.
198+
if [ "x$SOURCES" != "x" ]; then
199+
SOURCES="${SOURCES}\n "
200+
fi
201+
SOURCES="${SOURCES}${SOURCE_PREFIX}${root}${SOURCE_POSTFIX}"
198202
done
199203

200204
add_replacement "###SOURCE_ROOTS###" "$SOURCES"

make/Hsdis.gmk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ ifeq ($(HSDIS_BACKEND), capstone)
4444
else ifeq ($(call isTargetCpuArch, aarch64), true)
4545
CAPSTONE_ARCH := CS_ARCH_$(CAPSTONE_ARCH_AARCH64_NAME)
4646
CAPSTONE_MODE := CS_MODE_ARM
47+
else ifeq ($(call isTargetCpuArch, arm), true)
48+
CAPSTONE_ARCH := CS_ARCH_ARM
49+
CAPSTONE_MODE := CS_MODE_ARM
4750
else
4851
$(error No support for Capstone on this platform)
4952
endif

make/autoconf/flags-cflags.m4

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
544544
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
545545
TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
546546
# reduce lib size on linux in link step, this needs also special compile flags
547-
# do this on s390x also for libjvm (where serviceability agent is not supported)
548547
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
549548
TOOLCHAIN_CFLAGS_JDK="$TOOLCHAIN_CFLAGS_JDK -ffunction-sections -fdata-sections"
550-
if test "x$OPENJDK_TARGET_CPU" = xs390x && test "x$DEBUG_LEVEL" == xrelease; then
551-
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -fdata-sections"
552-
fi
549+
TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -ffunction-sections -fdata-sections"
553550
fi
554551
# technically NOT for CXX (but since this gives *worse* performance, use
555552
# no-strict-aliasing everywhere!)

make/autoconf/flags-ldflags.m4

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -53,16 +53,15 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
5353
# add --icf=all (Identical Code Folding — merges identical functions)
5454
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed -Wl,--exclude-libs,ALL"
5555
56+
BASIC_LDFLAGS_JVM_ONLY=""
5657
# Linux : remove unused code+data in link step
5758
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
58-
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
59-
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,--gc-sections"
60-
else
61-
BASIC_LDFLAGS_JDK_ONLY="$BASIC_LDFLAGS_JDK_ONLY -Wl,--gc-sections"
62-
fi
59+
# keep vtables : -Wl,--undefined-glob=_ZTV* (but this seems not to work with gold ld)
60+
# so keep at least the Metadata vtable that is used in the serviceability agent
61+
BASIC_LDFLAGS_JVM_ONLY="$BASIC_LDFLAGS_JVM_ONLY -Wl,--gc-sections -Wl,--undefined=_ZTV8Metadata"
62+
BASIC_LDFLAGS_JDK_ONLY="$BASIC_LDFLAGS_JDK_ONLY -Wl,--gc-sections"
6363
fi
6464
65-
BASIC_LDFLAGS_JVM_ONLY=""
6665
LDFLAGS_LTO="-flto=auto -fuse-linker-plugin -fno-strict-aliasing $DEBUG_PREFIX_CFLAGS"
6766
6867
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"

make/jdk/src/classes/build/tools/cldrconverter/CLDRConverter.java

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,7 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
801801
String tzKey = Optional.ofNullable((String)handlerSupplMeta.get(tzid))
802802
.orElse(tzid);
803803
// Follow link, if needed
804-
String tzLink = null;
805-
for (var k = tzKey; tzdbLinks.containsKey(k);) {
806-
k = tzLink = tzdbLinks.get(k);
807-
}
804+
String tzLink = getTZDBLink(tzKey);
808805
if (tzLink == null && tzdbLinks.containsValue(tzKey)) {
809806
// reverse link search
810807
// this is needed as in tzdb, "America/Buenos_Aires" links to
@@ -833,7 +830,7 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
833830
} else {
834831
// TZDB short names
835832
tznames = Arrays.copyOf(tznames, tznames.length);
836-
fillTZDBShortNames(tzid, tznames);
833+
fillTZDBShortNames(tzKey, tznames);
837834
names.put(tzid, tznames);
838835
}
839836
} else {
@@ -846,11 +843,13 @@ private static Map<String, Object> extractZoneNames(Map<String, Object> map, Str
846843
String metaKey = METAZONE_ID_PREFIX + meta;
847844
data = map.get(metaKey);
848845
if (data instanceof String[] tznames) {
849-
// TZDB short names
850-
tznames = Arrays.copyOf((String[])names.getOrDefault(metaKey, tznames), 6);
851-
fillTZDBShortNames(tzid, tznames);
852-
// Keep the metazone prefix here.
853-
names.putIfAbsent(metaKey, tznames);
846+
if (isDefaultZone(meta, tzKey)) {
847+
// Record the metazone names only from the default
848+
// (001) zone, with short names filled from TZDB
849+
tznames = Arrays.copyOf(tznames, tznames.length);
850+
fillTZDBShortNames(tzKey, tznames);
851+
names.put(metaKey, tznames);
852+
}
854853
names.put(tzid, meta);
855854
if (tzLink != null && availableIds.contains(tzLink)) {
856855
names.put(tzLink, meta);
@@ -1504,12 +1503,12 @@ private static String flipIfNeeded(boolean inVanguard, String format) {
15041503
* Fill the TZDB short names if there is no name provided by the CLDR
15051504
*/
15061505
private static void fillTZDBShortNames(String tzid, String[] names) {
1507-
var val = tzdbShortNamesMap.get(tzdbLinks.getOrDefault(tzid, tzid));
1506+
var val = tzdbShortNamesMap.getOrDefault(tzid, tzdbShortNamesMap.get(getTZDBLink(tzid)));
15081507
if (val != null) {
15091508
var format = val.split(NBSP)[0];
15101509
var rule = val.split(NBSP)[1];
15111510
IntStream.of(1, 3, 5).forEach(i -> {
1512-
if (names[i] == null) {
1511+
if (names[i] == null || names[i].isEmpty()) {
15131512
if (format.contains("%s")) {
15141513
names[i] = switch (i) {
15151514
case 1 -> format.formatted(tzdbSubstLetters.get(rule + NBSP + STD));
@@ -1531,6 +1530,21 @@ private static void fillTZDBShortNames(String tzid, String[] names) {
15311530
}
15321531
}
15331532

1533+
private static boolean isDefaultZone(String meta, String tzid) {
1534+
String zone001 = handlerMetaZones.zidMap().get(meta);
1535+
var tzLink = getTZDBLink(tzid);
1536+
return canonicalTZMap.getOrDefault(tzid, tzid).equals(zone001) ||
1537+
tzLink != null && canonicalTZMap.getOrDefault(tzLink, tzLink).equals(zone001);
1538+
}
1539+
1540+
private static String getTZDBLink(String tzid) {
1541+
String tzLink = null;
1542+
for (var k = tzid; tzdbLinks.containsKey(k);) {
1543+
k = tzLink = tzdbLinks.get(k);
1544+
}
1545+
return tzLink;
1546+
}
1547+
15341548
/*
15351549
* Convert TZDB offsets to JDK's offsets, eg, "-08" to "GMT-08:00".
15361550
* If it cannot recognize the pattern, return the argument as is.

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -55,6 +55,12 @@ else
5555
LIBSAPROC_LINK_TYPE := C
5656
endif
5757

58+
# DWARF related sources would be included on supported platforms only.
59+
LIBSAPROC_EXCLUDE_FILES :=
60+
ifneq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, x86_64 aarch64)), true)
61+
LIBSAPROC_EXCLUDE_FILES := DwarfParser.cpp dwarf.cpp
62+
endif
63+
5864
$(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
5965
NAME := saproc, \
6066
LINK_TYPE := $(LIBSAPROC_LINK_TYPE), \
@@ -70,6 +76,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
7076
CFLAGS := $(LIBSAPROC_CFLAGS), \
7177
CXXFLAGS := $(LIBSAPROC_CFLAGS) $(LIBSAPROC_CXXFLAGS), \
7278
EXTRA_SRC := $(LIBSAPROC_EXTRA_SRC), \
79+
EXCLUDE_FILES := $(LIBSAPROC_EXCLUDE_FILES), \
7380
JDK_LIBS := java.base:libjava, \
7481
LIBS_linux := $(LIBDL), \
7582
LIBS_macosx := \

src/hotspot/cpu/aarch64/aarch64_vector.ad

Lines changed: 84 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved.
3-
// Copyright (c) 2020, 2025, Arm Limited. All rights reserved.
3+
// Copyright (c) 2020, 2026, Arm Limited. All rights reserved.
44
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
//
66
// This code is free software; you can redistribute it and/or modify it
@@ -247,10 +247,39 @@ source %{
247247
case Op_MinVHF:
248248
case Op_MaxVHF:
249249
case Op_SqrtVHF:
250+
if (UseSVE == 0 && !is_feat_fp16_supported()) {
251+
return false;
252+
}
253+
break;
254+
// At the time of writing this, the Vector API has no half-float (FP16) species.
255+
// Consequently, AddReductionVHF and MulReductionVHF are only produced by the
256+
// auto-vectorizer, which requires strictly ordered semantics for FP reductions.
257+
//
258+
// There is no direct Neon instruction that performs strictly ordered floating
259+
// point add reduction. Hence, on Neon only machines, the add reduction operation
260+
// is implemented as a scalarized sequence using half-precision scalar instruction
261+
// FADD which requires FEAT_FP16 and ASIMDHP to be available on the target.
262+
// On SVE machines (UseSVE > 0) however, there is a direct instruction (FADDA) which
263+
// implements strictly ordered floating point add reduction which does not require
264+
// the FEAT_FP16 and ASIMDHP checks as SVE supports half-precision floats by default.
265+
case Op_AddReductionVHF:
250266
// FEAT_FP16 is enabled if both "fphp" and "asimdhp" features are supported.
251267
// Only the Neon instructions need this check. SVE supports half-precision floats
252268
// by default.
253-
if (UseSVE == 0 && !is_feat_fp16_supported()) {
269+
if (length_in_bytes < 8 || (UseSVE == 0 && !is_feat_fp16_supported())) {
270+
return false;
271+
}
272+
break;
273+
case Op_MulReductionVHF:
274+
// There are no direct Neon/SVE instructions that perform strictly ordered
275+
// floating point multiply reduction.
276+
// For vector length ≤ 16 bytes, the reduction is implemented as a scalarized
277+
// sequence using half-precision scalar instruction FMUL. This path requires
278+
// FEAT_FP16 and ASIMDHP to be available on the target.
279+
// For vector length > 16 bytes, this operation is disabled because there is no
280+
// direct SVE instruction that performs a strictly ordered FP16 multiply
281+
// reduction.
282+
if (length_in_bytes < 8 || length_in_bytes > 16 || !is_feat_fp16_supported()) {
254283
return false;
255284
}
256285
break;
@@ -300,6 +329,7 @@ source %{
300329
case Op_VectorRearrange:
301330
case Op_MulReductionVD:
302331
case Op_MulReductionVF:
332+
case Op_MulReductionVHF:
303333
case Op_MulReductionVI:
304334
case Op_MulReductionVL:
305335
case Op_CompressBitsV:
@@ -364,6 +394,7 @@ source %{
364394
case Op_VectorMaskCmp:
365395
case Op_LoadVectorGather:
366396
case Op_StoreVectorScatter:
397+
case Op_AddReductionVHF:
367398
case Op_AddReductionVF:
368399
case Op_AddReductionVD:
369400
case Op_AndReductionV:
@@ -597,13 +628,9 @@ instruct vloadcon(vReg dst, immI0 src) %{
597628
BasicType bt = Matcher::vector_element_basic_type(this);
598629
if (UseSVE == 0) {
599630
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
631+
int entry_idx = __ vector_iota_entry_index(bt);
600632
assert(length_in_bytes <= 16, "must be");
601-
// The iota indices are ordered by type B/S/I/L/F/D, and the offset between two types is 16.
602-
int offset = exact_log2(type2aelembytes(bt)) << 4;
603-
if (is_floating_point_type(bt)) {
604-
offset += 32;
605-
}
606-
__ lea(rscratch1, ExternalAddress(StubRoutines::aarch64::vector_iota_indices() + offset));
633+
__ lea(rscratch1, ExternalAddress(StubRoutines::aarch64::vector_iota_indices(entry_idx)));
607634
if (length_in_bytes == 16) {
608635
__ ldrq($dst$$FloatRegister, rscratch1);
609636
} else {
@@ -3406,6 +3433,44 @@ instruct reduce_non_strict_order_add4F_neon(vRegF dst, vRegF fsrc, vReg vsrc, vR
34063433
ins_pipe(pipe_slow);
34073434
%}
34083435

3436+
// Add Reduction for Half floats (FP16).
3437+
// Neon does not provide direct instructions for strictly ordered floating-point add reductions.
3438+
// On Neon-only targets (UseSVE = 0), this operation is implemented as a sequence of scalar additions:
3439+
// values equal to the vector width are loaded into a vector register, each lane is extracted,
3440+
// and its value is accumulated into the running sum, producing a final scalar result.
3441+
instruct reduce_addHF_neon(vRegF dst, vRegF fsrc, vReg vsrc, vReg tmp) %{
3442+
predicate(UseSVE == 0);
3443+
match(Set dst (AddReductionVHF fsrc vsrc));
3444+
effect(TEMP_DEF dst, TEMP tmp);
3445+
format %{ "reduce_addHF $dst, $fsrc, $vsrc\t# 4HF/8HF. KILL $tmp" %}
3446+
ins_encode %{
3447+
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
3448+
__ neon_reduce_add_fp16($dst$$FloatRegister, $fsrc$$FloatRegister,
3449+
$vsrc$$FloatRegister, length_in_bytes, $tmp$$FloatRegister);
3450+
%}
3451+
ins_pipe(pipe_slow);
3452+
%}
3453+
3454+
// This rule calculates the reduction result in strict order. Two cases will
3455+
// reach here:
3456+
// 1. Non strictly-ordered AddReductionVHF when vector size > 128-bits. For example -
3457+
// AddReductionVHF generated by Vector API. For vector size > 128-bits, it is more
3458+
// beneficial performance-wise to generate direct SVE instruction even if it is
3459+
// strictly ordered.
3460+
// 2. Strictly-ordered AddReductionVHF. For example - AddReductionVHF generated by
3461+
// auto-vectorization on SVE machine.
3462+
instruct reduce_addHF_sve(vRegF dst_src1, vReg src2) %{
3463+
predicate(UseSVE > 0);
3464+
match(Set dst_src1 (AddReductionVHF dst_src1 src2));
3465+
format %{ "reduce_addHF_sve $dst_src1, $dst_src1, $src2" %}
3466+
ins_encode %{
3467+
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $src2);
3468+
assert(length_in_bytes == MaxVectorSize, "invalid vector length");
3469+
__ sve_fadda($dst_src1$$FloatRegister, __ H, ptrue, $src2$$FloatRegister);
3470+
%}
3471+
ins_pipe(pipe_slow);
3472+
%}
3473+
34093474
// This rule calculates the reduction result in strict order. Two cases will
34103475
// reach here:
34113476
// 1. Non strictly-ordered AddReductionVF when vector size > 128-bits. For example -
@@ -3496,12 +3561,14 @@ instruct reduce_addL_masked(iRegLNoSp dst, iRegL isrc, vReg vsrc, pRegGov pg, vR
34963561
ins_pipe(pipe_slow);
34973562
%}
34983563

3499-
instruct reduce_addF_masked(vRegF dst_src1, vReg src2, pRegGov pg) %{
3564+
instruct reduce_addFHF_masked(vRegF dst_src1, vReg src2, pRegGov pg) %{
35003565
predicate(UseSVE > 0);
3566+
match(Set dst_src1 (AddReductionVHF (Binary dst_src1 src2) pg));
35013567
match(Set dst_src1 (AddReductionVF (Binary dst_src1 src2) pg));
3502-
format %{ "reduce_addF_masked $dst_src1, $pg, $dst_src1, $src2" %}
3568+
format %{ "reduce_addFHF_masked $dst_src1, $pg, $dst_src1, $src2" %}
35033569
ins_encode %{
3504-
__ sve_fadda($dst_src1$$FloatRegister, __ S,
3570+
BasicType bt = Matcher::vector_element_basic_type(this, $src2);
3571+
__ sve_fadda($dst_src1$$FloatRegister, __ elemType_to_regVariant(bt),
35053572
$pg$$PRegister, $src2$$FloatRegister);
35063573
%}
35073574
ins_pipe(pipe_slow);
@@ -3549,14 +3616,17 @@ instruct reduce_mulL(iRegLNoSp dst, iRegL isrc, vReg vsrc) %{
35493616
ins_pipe(pipe_slow);
35503617
%}
35513618

3552-
instruct reduce_mulF(vRegF dst, vRegF fsrc, vReg vsrc, vReg tmp) %{
3619+
3620+
instruct reduce_mulFHF(vRegF dst, vRegF fsrc, vReg vsrc, vReg tmp) %{
35533621
predicate(Matcher::vector_length_in_bytes(n->in(2)) <= 16);
3622+
match(Set dst (MulReductionVHF fsrc vsrc));
35543623
match(Set dst (MulReductionVF fsrc vsrc));
35553624
effect(TEMP_DEF dst, TEMP tmp);
3556-
format %{ "reduce_mulF $dst, $fsrc, $vsrc\t# 2F/4F. KILL $tmp" %}
3625+
format %{ "reduce_mulFHF $dst, $fsrc, $vsrc\t# 2F/4F/4HF/8HF. KILL $tmp" %}
35573626
ins_encode %{
35583627
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
3559-
__ neon_reduce_mul_fp($dst$$FloatRegister, T_FLOAT, $fsrc$$FloatRegister,
3628+
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
3629+
__ neon_reduce_mul_fp($dst$$FloatRegister, bt, $fsrc$$FloatRegister,
35603630
$vsrc$$FloatRegister, length_in_bytes, $tmp$$FloatRegister);
35613631
%}
35623632
ins_pipe(pipe_slow);

0 commit comments

Comments
 (0)