Skip to content

Commit de7b2ce

Browse files
authored
Merge pull request #2140 from SAP/pr-jdk-27+2
Merge to tag jdk-27+2
2 parents 2db0c7c + 2593b78 commit de7b2ce

File tree

252 files changed

+15407
-5485
lines changed

Some content is hidden

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

252 files changed

+15407
-5485
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,21 @@
33
<img align="right" width=350 src="https://sapmachine.io/assets/images/logo_circular.svg">
44

55
# [](#SapMachine) SapMachine
6-
This project contains a downstream version of the [OpenJDK](https://openjdk.org/) project. It is used to build and maintain a SAP supported version of OpenJDK for SAP customers and partners who wish to use OpenJDK to run their applications.
6+
SapMachine is a downstream fork of the [OpenJDK](https://openjdk.org/) project. Its purpose is to build and support a binary distribution of OpenJDK for SAP customers and partners.
77

8-
We want to stress that this is clearly a "*friendly fork*". SAP is committed to ensuring the continued success of the Java platform.
8+
While maintaining SapMachine, SAP is committed to ensuring the continued success of the Java platform and the OpenJDK project and therefore works in an OpenJDK-upstream-first model. To learn more about our engagement in the OpenJDK, visit [this site](https://sapmachine.io/docs/sap-in-openjdk).
99

10-
More details about the *SAP’s Engagement in the OpenJDK project*, *installation instructions*, *frequently asked questions*, *the maintenance and support statement*, and more are available in the [documentation](https://sapmachine.io/docs).
10+
More details about SapMachine, such as *installation instructions*, *frequently asked questions*, *the maintenance and support statement*, and more are available in the [documentation pages](https://sapmachine.io/docs).
1111

1212
## Have an issue?
1313
If it's SapMachine specific please let us know by filing a [new issue](https://github.com/SAP/SapMachine/issues/new).
1414

15-
Please notice that the SapMachine [issue tracker](https://github.com/SAP/SapMachine/issues) is mainly used internally by the SapMachine team to organize its work (i.e. sync with upstream, downporting fixes, add SapMachine specific features, etc.).
15+
General JVM/JDK bugs are maintained directly in the [OpenJDK Bug System](https://bugs.openjdk.org/). You can open a SapMachine issue with a reference to an open or resolved OpenJDK bug if you want us to resolve the issue or downport the fix to a specific SapMachine version. If you find a general JVM/JDK bug in SapMachine and don't have editor access to the OpenJDK Bug System you can open an issue here and we'll take care to open a corresponding OpenJDK bug for it.
1616

17-
General VM/JDK bugs are maintained directly in the [OpenJDK Bug System](https://bugs.openjdk.java.net/). You can open a SapMachine issue with a reference to an open or resolved OpenJDK bug if you want us to resolve the issue or downport the fix to a specific SapMachine version. If you find a general VM/JDK bug in SapMachine and don't have write access to the OpenJDK Bug System you can open an issue here and we'll take care to open a corresponding OpenJDK bug for it.
18-
19-
Every SapMachine release contains at least all the fixes of the corresponding OpenJDK release it is based on.
17+
Since SapMachine tracks the OpenJDK, every SapMachine release contains all the fixes/changes of the corresponding OpenJDK release it is based on.
2018

2119
## Contributing
22-
We currently do not accept external contributions for this project. If you want to improve the code or fix a bug please consider contributing directly to the upstream [OpenJDK](http://openjdk.java.net/contribute/) project. Our repositories will be regularly synced with the upstream project so any improvements in the upstream OpenJDK project will directly become visible in our project as well.
20+
We currently do not accept external contributions for this project. If you want to improve the code or fix a bug please consider contributing directly to the upstream [OpenJDK](https://openjdk.org/contribute/) project. Our repositories will be regularly synced with OpenJDK, so any improvements in upstream will become effective in SapMachine as well.
2321

2422
## License
2523
This project is run under the same licensing terms as the upstream OpenJDK project. Please see the [LICENSE](LICENSE) file in the top-level directory for more information.

make/RunTests.gmk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -873,16 +873,16 @@ define SetupRunJtregTestBody
873873
$1_JTREG_BASIC_OPTIONS += -testThreadFactoryPath:$$(JTREG_TEST_THREAD_FACTORY_JAR)
874874
$1_JTREG_BASIC_OPTIONS += -testThreadFactory:$$(JTREG_TEST_THREAD_FACTORY)
875875
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
876-
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-$$(JTREG_TEST_THREAD_FACTORY).txt) \
876+
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-$$(JTREG_TEST_THREAD_FACTORY).txt) \
877877
))
878878
endif
879879

880880
ifneq ($$(JTREG_JVMTI_STRESS_AGENT), )
881881
AGENT := $$(LIBRARY_PREFIX)JvmtiStressAgent$$(SHARED_LIBRARY_SUFFIX)=$$(JTREG_JVMTI_STRESS_AGENT)
882882
$1_JTREG_BASIC_OPTIONS += -javaoption:'-agentpath:$(TEST_IMAGE_DIR)/hotspot/jtreg/native/$$(AGENT)'
883883
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
884-
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
885-
))
884+
$$(addprefix $$($1_TEST_ROOT)/, ProblemList-jvmti-stress-agent.txt) \
885+
))
886886
endif
887887

888888

@@ -1092,7 +1092,7 @@ define SetupRunJtregTestBody
10921092
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \
10931093
$$($1_TEST_TMP_DIR))
10941094
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \
1095-
$$(COV_ENVIRONMENT) $$($1_COMMAND_LINE) \
1095+
$$(COV_ENVIRONMENT) $$($1_COMMAND_LINE) \
10961096
)
10971097

10981098
$1_RESULT_FILE := $$($1_TEST_RESULTS_DIR)/text/stats.txt
@@ -1102,11 +1102,11 @@ define SetupRunJtregTestBody
11021102
$$(call LogWarn, Test report is stored in $$(strip \
11031103
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
11041104

1105-
# Read jtreg documentation to learn on the test stats categories:
1106-
# https://github.com/openjdk/jtreg/blob/master/src/share/doc/javatest/regtest/faq.md#what-do-all-those-numbers-in-the-test-results-line-mean
1107-
# In jtreg, "skipped:" category accounts for tests that threw jtreg.SkippedException at runtime.
1108-
# At the same time these tests contribute to "passed:" tests.
1109-
# In here we don't want that and so we substract number of "skipped:" from "passed:".
1105+
# Read jtreg documentation to learn on the test stats categories:
1106+
# https://github.com/openjdk/jtreg/blob/master/src/share/doc/javatest/regtest/faq.md#what-do-all-those-numbers-in-the-test-results-line-mean
1107+
# In jtreg, "skipped:" category accounts for tests that threw jtreg.SkippedException at runtime.
1108+
# At the same time these tests contribute to "passed:" tests.
1109+
# In here we don't want that and so we substract number of "skipped:" from "passed:".
11101110

11111111
$$(if $$(wildcard $$($1_RESULT_FILE)), \
11121112
$$(eval $1_PASSED_AND_RUNTIME_SKIPPED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \

make/common/native/Flags.gmk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ define SetupLinkerFlags
234234
ifeq ($(call isTargetOs, macosx), true)
235235
$1_EXTRA_LDFLAGS += -Wl,-object_path_lto,$$($1_OBJECT_DIR)/$$($1_NAME)_lto_helper.o
236236
endif
237+
ifeq ($(TOOLCHAIN_TYPE), microsoft)
238+
$1_EXTRA_LDFLAGS += -LTCGOUT:$$($1_OBJECT_DIR)/$$($1_NAME).iobj
239+
endif
237240
endif
238241

239242
$1_EXTRA_LDFLAGS += $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) \

make/conf/jib-profiles.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,8 +1192,8 @@ var getJibProfilesDependencies = function (input, common) {
11921192
server: "jpg",
11931193
product: "jcov",
11941194
version: "3.0",
1195-
build_number: "3",
1196-
file: "bundles/jcov-3.0+3.zip",
1195+
build_number: "5",
1196+
file: "bundles/jcov-3.0+5.zip",
11971197
environment_name: "JCOV_HOME",
11981198
},
11991199

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
226226
EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
227227
EXCLUDES := $(LIBSPLASHSCREEN_EXCLUDES), \
228228
OPTIMIZATION := SIZE, \
229-
LINK_TIME_OPTIMIZATION := true, \
230229
CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) \
231230
$(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS) $(LIBZ_CFLAGS) \
232231
$(ICONV_CFLAGS), \

src/hotspot/cpu/aarch64/aarch64_vector.ad

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,14 @@ source %{
346346
}
347347

348348
bool Matcher::vector_needs_partial_operations(Node* node, const TypeVect* vt) {
349-
// Only SVE has partial vector operations
350-
if (UseSVE == 0) {
349+
// 1. Only SVE requires partial vector operations.
350+
// 2. The vector size in bytes must be smaller than MaxVectorSize.
351+
// 3. Predicated vectors have a mask input, which guarantees that
352+
// out-of-bounds lanes remain inactive.
353+
int length_in_bytes = vt->length_in_bytes();
354+
if (UseSVE == 0 ||
355+
length_in_bytes == MaxVectorSize ||
356+
node->is_predicated_vector()) {
351357
return false;
352358
}
353359

@@ -370,21 +376,22 @@ source %{
370376
return !node->in(1)->is_Con();
371377
case Op_LoadVector:
372378
case Op_StoreVector:
373-
// We use NEON load/store instructions if the vector length is <= 128 bits.
374-
return vt->length_in_bytes() > 16;
375379
case Op_AddReductionVI:
376380
case Op_AddReductionVL:
377-
// We may prefer using NEON instructions rather than SVE partial operations.
378-
return !VM_Version::use_neon_for_vector(vt->length_in_bytes());
381+
// For these ops, we prefer using NEON instructions rather than SVE
382+
// predicated instructions for better performance.
383+
return !VM_Version::use_neon_for_vector(length_in_bytes);
379384
case Op_MinReductionV:
380385
case Op_MaxReductionV:
381-
// For BYTE/SHORT/INT/FLOAT/DOUBLE types, we may prefer using NEON
382-
// instructions rather than SVE partial operations.
386+
// For BYTE/SHORT/INT/FLOAT/DOUBLE types, we prefer using NEON
387+
// instructions rather than SVE predicated instructions for
388+
// better performance.
383389
return vt->element_basic_type() == T_LONG ||
384-
!VM_Version::use_neon_for_vector(vt->length_in_bytes());
390+
!VM_Version::use_neon_for_vector(length_in_bytes);
385391
default:
386-
// For other ops whose vector size is smaller than the max vector size, a
387-
// full-sized unpredicated operation does not impact the final vector result.
392+
// For other ops whose vector size is smaller than the max vector
393+
// size, a full-sized unpredicated operation does not impact the
394+
// vector result.
388395
return false;
389396
}
390397
}

src/hotspot/cpu/aarch64/aarch64_vector_ad.m4

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,14 @@ source %{
336336
}
337337

338338
bool Matcher::vector_needs_partial_operations(Node* node, const TypeVect* vt) {
339-
// Only SVE has partial vector operations
340-
if (UseSVE == 0) {
339+
// 1. Only SVE requires partial vector operations.
340+
// 2. The vector size in bytes must be smaller than MaxVectorSize.
341+
// 3. Predicated vectors have a mask input, which guarantees that
342+
// out-of-bounds lanes remain inactive.
343+
int length_in_bytes = vt->length_in_bytes();
344+
if (UseSVE == 0 ||
345+
length_in_bytes == MaxVectorSize ||
346+
node->is_predicated_vector()) {
341347
return false;
342348
}
343349

@@ -360,21 +366,22 @@ source %{
360366
return !node->in(1)->is_Con();
361367
case Op_LoadVector:
362368
case Op_StoreVector:
363-
// We use NEON load/store instructions if the vector length is <= 128 bits.
364-
return vt->length_in_bytes() > 16;
365369
case Op_AddReductionVI:
366370
case Op_AddReductionVL:
367-
// We may prefer using NEON instructions rather than SVE partial operations.
368-
return !VM_Version::use_neon_for_vector(vt->length_in_bytes());
371+
// For these ops, we prefer using NEON instructions rather than SVE
372+
// predicated instructions for better performance.
373+
return !VM_Version::use_neon_for_vector(length_in_bytes);
369374
case Op_MinReductionV:
370375
case Op_MaxReductionV:
371-
// For BYTE/SHORT/INT/FLOAT/DOUBLE types, we may prefer using NEON
372-
// instructions rather than SVE partial operations.
376+
// For BYTE/SHORT/INT/FLOAT/DOUBLE types, we prefer using NEON
377+
// instructions rather than SVE predicated instructions for
378+
// better performance.
373379
return vt->element_basic_type() == T_LONG ||
374-
!VM_Version::use_neon_for_vector(vt->length_in_bytes());
380+
!VM_Version::use_neon_for_vector(length_in_bytes);
375381
default:
376-
// For other ops whose vector size is smaller than the max vector size, a
377-
// full-sized unpredicated operation does not impact the final vector result.
382+
// For other ops whose vector size is smaller than the max vector
383+
// size, a full-sized unpredicated operation does not impact the
384+
// vector result.
378385
return false;
379386
}
380387
}

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5379,7 +5379,6 @@ void MacroAssembler::set_narrow_klass(Register dst, Klass* k) {
53795379
assert (UseCompressedClassPointers, "should only be used for compressed headers");
53805380
assert (oop_recorder() != nullptr, "this assembler needs an OopRecorder");
53815381
int index = oop_recorder()->find_index(k);
5382-
assert(! Universe::heap()->is_in(k), "should not be an oop");
53835382

53845383
InstructionMark im(this);
53855384
RelocationHolder rspec = metadata_Relocation::spec(index);

src/hotspot/cpu/ppc/ppc.ad

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6335,8 +6335,36 @@ instruct loadConD_Ex(regD dst, immD src) %{
63356335
// Prefetch instructions.
63366336
// Must be safe to execute with invalid address (cannot fault).
63376337

6338+
// Special prefetch versions which use the dcbz instruction.
6339+
instruct prefetch_alloc_zero(indirectMemory mem, iRegLsrc src) %{
6340+
match(PrefetchAllocation (AddP mem src));
6341+
predicate(AllocatePrefetchStyle == 3);
6342+
ins_cost(MEMORY_REF_COST);
6343+
6344+
format %{ "PREFETCH $mem, 2, $src \t// Prefetch write-many with zero" %}
6345+
size(4);
6346+
ins_encode %{
6347+
__ dcbz($src$$Register, $mem$$base$$Register);
6348+
%}
6349+
ins_pipe(pipe_class_memory);
6350+
%}
6351+
6352+
instruct prefetch_alloc_zero_no_offset(indirectMemory mem) %{
6353+
match(PrefetchAllocation mem);
6354+
predicate(AllocatePrefetchStyle == 3);
6355+
ins_cost(MEMORY_REF_COST);
6356+
6357+
format %{ "PREFETCH $mem, 2 \t// Prefetch write-many with zero" %}
6358+
size(4);
6359+
ins_encode %{
6360+
__ dcbz($mem$$base$$Register);
6361+
%}
6362+
ins_pipe(pipe_class_memory);
6363+
%}
6364+
63386365
instruct prefetch_alloc(indirectMemory mem, iRegLsrc src) %{
63396366
match(PrefetchAllocation (AddP mem src));
6367+
predicate(AllocatePrefetchStyle != 3);
63406368
ins_cost(MEMORY_REF_COST);
63416369

63426370
format %{ "PREFETCH $mem, 2, $src \t// Prefetch write-many" %}
@@ -6349,6 +6377,7 @@ instruct prefetch_alloc(indirectMemory mem, iRegLsrc src) %{
63496377

63506378
instruct prefetch_alloc_no_offset(indirectMemory mem) %{
63516379
match(PrefetchAllocation mem);
6380+
predicate(AllocatePrefetchStyle != 3);
63526381
ins_cost(MEMORY_REF_COST);
63536382

63546383
format %{ "PREFETCH $mem, 2 \t// Prefetch write-many" %}

src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,6 +2067,83 @@ void C2_MacroAssembler::enc_cmove_cmp_fp(int cmpFlag, FloatRegister op1, FloatRe
20672067
}
20682068
}
20692069

2070+
void C2_MacroAssembler::enc_cmove_fp_cmp(int cmpFlag, Register op1, Register op2,
2071+
FloatRegister dst, FloatRegister src, bool is_single) {
2072+
bool is_unsigned = (cmpFlag & unsigned_branch_mask) == unsigned_branch_mask;
2073+
int op_select = cmpFlag & (~unsigned_branch_mask);
2074+
2075+
switch (op_select) {
2076+
case BoolTest::eq:
2077+
cmov_fp_eq(op1, op2, dst, src, is_single);
2078+
break;
2079+
case BoolTest::ne:
2080+
cmov_fp_ne(op1, op2, dst, src, is_single);
2081+
break;
2082+
case BoolTest::le:
2083+
if (is_unsigned) {
2084+
cmov_fp_leu(op1, op2, dst, src, is_single);
2085+
} else {
2086+
cmov_fp_le(op1, op2, dst, src, is_single);
2087+
}
2088+
break;
2089+
case BoolTest::ge:
2090+
if (is_unsigned) {
2091+
cmov_fp_geu(op1, op2, dst, src, is_single);
2092+
} else {
2093+
cmov_fp_ge(op1, op2, dst, src, is_single);
2094+
}
2095+
break;
2096+
case BoolTest::lt:
2097+
if (is_unsigned) {
2098+
cmov_fp_ltu(op1, op2, dst, src, is_single);
2099+
} else {
2100+
cmov_fp_lt(op1, op2, dst, src, is_single);
2101+
}
2102+
break;
2103+
case BoolTest::gt:
2104+
if (is_unsigned) {
2105+
cmov_fp_gtu(op1, op2, dst, src, is_single);
2106+
} else {
2107+
cmov_fp_gt(op1, op2, dst, src, is_single);
2108+
}
2109+
break;
2110+
default:
2111+
assert(false, "unsupported compare condition");
2112+
ShouldNotReachHere();
2113+
}
2114+
}
2115+
2116+
void C2_MacroAssembler::enc_cmove_fp_cmp_fp(int cmpFlag,
2117+
FloatRegister op1, FloatRegister op2,
2118+
FloatRegister dst, FloatRegister src,
2119+
bool cmp_single, bool cmov_single) {
2120+
int op_select = cmpFlag & (~unsigned_branch_mask);
2121+
2122+
switch (op_select) {
2123+
case BoolTest::eq:
2124+
cmov_fp_cmp_fp_eq(op1, op2, dst, src, cmp_single, cmov_single);
2125+
break;
2126+
case BoolTest::ne:
2127+
cmov_fp_cmp_fp_ne(op1, op2, dst, src, cmp_single, cmov_single);
2128+
break;
2129+
case BoolTest::le:
2130+
cmov_fp_cmp_fp_le(op1, op2, dst, src, cmp_single, cmov_single);
2131+
break;
2132+
case BoolTest::ge:
2133+
cmov_fp_cmp_fp_ge(op1, op2, dst, src, cmp_single, cmov_single);
2134+
break;
2135+
case BoolTest::lt:
2136+
cmov_fp_cmp_fp_lt(op1, op2, dst, src, cmp_single, cmov_single);
2137+
break;
2138+
case BoolTest::gt:
2139+
cmov_fp_cmp_fp_gt(op1, op2, dst, src, cmp_single, cmov_single);
2140+
break;
2141+
default:
2142+
assert(false, "unsupported compare condition");
2143+
ShouldNotReachHere();
2144+
}
2145+
}
2146+
20702147
// Set dst to NaN if any NaN input.
20712148
void C2_MacroAssembler::minmax_fp(FloatRegister dst, FloatRegister src1, FloatRegister src2,
20722149
FLOAT_TYPE ft, bool is_min) {

0 commit comments

Comments
 (0)