Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge to tag jdk-21.0.4+2 #1666

Merged
merged 20 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3892078
8324121: SIGFPE in PhaseIdealLoop::extract_long_range_checks
shipilev May 2, 2024
87d5da4
8328822: C2: "negative trip count?" assert failure in profile predica…
shipilev May 2, 2024
a4d8d06
8328744: Parallel: Parallel GC throws OOM before heap is fully expanded
zhengyu123 May 2, 2024
3bb8eee
8317809: Insertion of free code blobs into code cache can be very slo…
GoeLin May 3, 2024
835d016
8330094: RISC-V: Save and restore FRM in the call stub
zifeihan May 5, 2024
d459ae9
8329850: [AIX] Allow loading of different members of same shared libr…
May 6, 2024
021372c
8328703: Illegal accesses in Java_jdk_internal_org_jline_terminal_imp…
shipilev May 6, 2024
3770c28
8331331: :tier1 target explanation in doc/testing.md is incorrect
May 6, 2024
abbad92
8326201: [S390] Need to bailout cleanly if creation of stubs fails wh…
offamitkumar May 6, 2024
3ff5359
8330011: [s390x] update block-comments to make code consistent
offamitkumar May 6, 2024
9159882
8310513: [s390x] Intrinsify recursive ObjectMonitor locking
offamitkumar May 6, 2024
2b858f5
8328938: C2 SuperWord: disable vectorization for large stride and scale
shipilev May 6, 2024
16ba673
8331639: [21u]: Bump GHA bootstrap JDK to 21.0.3
RealCLanger May 6, 2024
7a400f2
8309890: TestStringDeduplicationInterned.java waits for the wrong con…
acmoraru May 6, 2024
ed2f5a8
8310228: Improve error reporting for uncaught native exceptions on Wi…
GoeLin May 7, 2024
92b43c5
8317007: Add bulk removal of dead nmethods during class unloading
GoeLin May 7, 2024
ec6b326
8310913: Move ReferencedKeyMap to jdk.internal so it may be shared
shipilev May 7, 2024
41fda4a
8319376: ParallelGC: Forwarded objects found during heap inspection
May 7, 2024
93d091a
8314573: G1: Heap resizing at Remark does not take existing eden regi…
May 7, 2024
3ad1c1d
Merge branch 'sapmachine21' into pr-jdk-21.0.4+2
RealCLanger May 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ <h2 id="test-selection">Test selection</h2>
<p>The test specifications given in <code>TEST</code> is parsed into
fully qualified test descriptors, which clearly and unambigously show
which tests will be run. As an example, <code>:tier1</code> will expand
to
<code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>.
to include all subcomponent test directories that define `tier1`,
for example:
<code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 ...</code>.
You can always submit a list of fully qualified test descriptors in the
<code>TEST</code> variable if you want to shortcut the parser.</p>
<h3 id="common-test-groups">Common Test Groups</h3>
Expand Down
10 changes: 5 additions & 5 deletions doc/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ test runs, the `test TEST="x"` solution needs to be used.

The test specifications given in `TEST` is parsed into fully qualified test
descriptors, which clearly and unambigously show which tests will be run. As an
example, `:tier1` will expand to `jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1
jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1
jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1`. You can
always submit a list of fully qualified test descriptors in the `TEST` variable
if you want to shortcut the parser.
example, `:tier1` will expand to include all subcomponent test directories
that define `tier1`, for example: `jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1
jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 ...`. You
can always submit a list of fully qualified test descriptors in the `TEST`
variable if you want to shortcut the parser.

### Common Test Groups

Expand Down
2 changes: 2 additions & 0 deletions make/test/JtregNativeHotspot.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,8 @@ else
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libMonitorWithDeadObjectTest += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack += -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeGetCreatedJavaVMs := -ljvm -lpthread

BUILD_HOTSPOT_JTREG_EXCLUDE += libNativeException.c
endif

ifeq ($(ASAN_ENABLED), true)
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/riscv/frame_riscv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
// Entry frames
// n.b. these values are determined by the layout defined in
// stubGenerator for the Java call stub
entry_frame_after_call_words = 34,
entry_frame_after_call_words = 35,
entry_frame_call_wrapper_offset = -10,

// we don't need a save area
Expand Down
9 changes: 0 additions & 9 deletions src/hotspot/cpu/riscv/riscv_v.ad
Original file line number Diff line number Diff line change
Expand Up @@ -2942,7 +2942,6 @@ instruct vloadcon(vReg dst, immI0 src) %{
__ vsetvli_helper(bt, Matcher::vector_length(this));
__ vid_v(as_VectorRegister($dst$$reg));
if (is_floating_point_type(bt)) {
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfcvt_f_x_v(as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg));
}
%}
Expand Down Expand Up @@ -3156,7 +3155,6 @@ instruct vcvtBtoX(vReg dst, vReg src) %{
if (is_floating_point_type(bt)) {
__ integer_extend_v(as_VectorRegister($dst$$reg), bt == T_FLOAT ? T_INT : T_LONG,
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_BYTE);
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfcvt_f_x_v(as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg));
} else {
__ integer_extend_v(as_VectorRegister($dst$$reg), bt,
Expand Down Expand Up @@ -3203,7 +3201,6 @@ instruct vcvtStoX_fp_extend(vReg dst, vReg src) %{
__ integer_extend_v(as_VectorRegister($dst$$reg), (bt == T_FLOAT ? T_INT : T_LONG),
Matcher::vector_length(this), as_VectorRegister($src$$reg), T_SHORT);
__ vsetvli_helper(bt, Matcher::vector_length(this));
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfcvt_f_x_v(as_VectorRegister($dst$$reg), as_VectorRegister($dst$$reg));
%}
ins_pipe(pipe_slow);
Expand Down Expand Up @@ -3242,7 +3239,6 @@ instruct vcvtItoF(vReg dst, vReg src) %{
format %{ "vcvtItoF $dst, $src" %}
ins_encode %{
__ vsetvli_helper(T_FLOAT, Matcher::vector_length(this));
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfcvt_f_x_v(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg));
%}
ins_pipe(pipe_slow);
Expand All @@ -3255,7 +3251,6 @@ instruct vcvtItoD(vReg dst, vReg src) %{
format %{ "vcvtItoD $dst, $src" %}
ins_encode %{
__ vsetvli_helper(T_INT, Matcher::vector_length(this), Assembler::mf2);
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfwcvt_f_x_v(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg));
%}
ins_pipe(pipe_slow);
Expand Down Expand Up @@ -3283,7 +3278,6 @@ instruct vcvtLtoF(vReg dst, vReg src) %{
format %{ "vcvtLtoF $dst, $src" %}
ins_encode %{
__ vsetvli_helper(T_FLOAT, Matcher::vector_length(this), Assembler::mf2);
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfncvt_f_x_w(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg));
%}
ins_pipe(pipe_slow);
Expand All @@ -3295,7 +3289,6 @@ instruct vcvtLtoD(vReg dst, vReg src) %{
format %{ "vcvtLtoD $dst, $src" %}
ins_encode %{
__ vsetvli_helper(T_DOUBLE, Matcher::vector_length(this));
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfcvt_f_x_v(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg));
%}
ins_pipe(pipe_slow);
Expand Down Expand Up @@ -3353,7 +3346,6 @@ instruct vcvtFtoD(vReg dst, vReg src) %{
format %{ "vcvtFtoD $dst, $src" %}
ins_encode %{
__ vsetvli_helper(T_FLOAT, Matcher::vector_length(this), Assembler::mf2);
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfwcvt_f_f_v(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg));
%}
ins_pipe(pipe_slow);
Expand Down Expand Up @@ -3401,7 +3393,6 @@ instruct vcvtDtoF(vReg dst, vReg src) %{
format %{ "vcvtDtoF $dst, $src" %}
ins_encode %{
__ vsetvli_helper(T_FLOAT, Matcher::vector_length(this), Assembler::mf2);
__ csrwi(CSR_FRM, C2_MacroAssembler::rne);
__ vfncvt_f_f_w(as_VectorRegister($dst$$reg), as_VectorRegister($src$$reg));
%}
ins_pipe(pipe_slow);
Expand Down
27 changes: 24 additions & 3 deletions src/hotspot/cpu/riscv/stubGenerator_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ class StubGenerator: public StubCodeGenerator {
// [ return_from_Java ] <--- sp
// [ argument word n ]
// ...
// -34 [ argument word 1 ]
// -33 [ saved f27 ] <--- sp_after_call
// -35 [ argument word 1 ]
// -34 [ saved FRM in Floating-point Control and Status Register ] <--- sp_after_call
// -33 [ saved f27 ]
// -32 [ saved f26 ]
// -31 [ saved f25 ]
// -30 [ saved f24 ]
Expand Down Expand Up @@ -164,8 +165,9 @@ class StubGenerator: public StubCodeGenerator {

// Call stub stack layout word offsets from fp
enum call_stub_layout {
sp_after_call_off = -33,
sp_after_call_off = -34,

frm_off = sp_after_call_off,
f27_off = -33,
f26_off = -32,
f25_off = -31,
Expand Down Expand Up @@ -213,6 +215,7 @@ class StubGenerator: public StubCodeGenerator {

const Address sp_after_call (fp, sp_after_call_off * wordSize);

const Address frm_save (fp, frm_off * wordSize);
const Address call_wrapper (fp, call_wrapper_off * wordSize);
const Address result (fp, result_off * wordSize);
const Address result_type (fp, result_type_off * wordSize);
Expand Down Expand Up @@ -295,6 +298,16 @@ class StubGenerator: public StubCodeGenerator {
__ fsd(f26, f26_save);
__ fsd(f27, f27_save);

__ frrm(t0);
__ sd(t0, frm_save);
// Set frm to the state we need. We do want Round to Nearest. We
// don't want non-IEEE rounding modes.
Label skip_fsrmi;
guarantee(__ RoundingMode::rne == 0, "must be");
__ beqz(t0, skip_fsrmi);
__ fsrmi(__ RoundingMode::rne);
__ bind(skip_fsrmi);

// install Java thread in global register now we have saved
// whatever value it held
__ mv(xthread, c_rarg7);
Expand Down Expand Up @@ -414,6 +427,14 @@ class StubGenerator: public StubCodeGenerator {

__ ld(x9, x9_save);

// restore frm
Label skip_fsrm;
__ ld(t0, frm_save);
__ frrm(t1);
__ beq(t0, t1, skip_fsrm);
__ fsrm(t0);
__ bind(skip_fsrm);

__ ld(c_rarg0, call_wrapper);
__ ld(c_rarg1, result);
__ ld(c_rarg2, result_type);
Expand Down
5 changes: 3 additions & 2 deletions src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2018 SAP SE. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 SAP SE. 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
Expand Down Expand Up @@ -428,6 +428,7 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
"must be aligned");

ce->emit_static_call_stub();
CHECK_BAILOUT();

// Prepend each BRASL with a nop.
__ relocate(relocInfo::static_call_type);
Expand Down
34 changes: 18 additions & 16 deletions src/hotspot/cpu/s390/downcallLinker_s390.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -166,10 +166,10 @@ void DowncallStubGenerator::generate() {
locs.set(StubLocations::TARGET_ADDRESS, _abi._scratch2);

if (_captured_state_mask != 0) {
__ block_comment("{ _captured_state_mask is set");
__ block_comment("_captured_state_mask_is_set {");
locs.set_frame_data(StubLocations::CAPTURED_STATE_BUFFER, allocated_frame_size);
allocated_frame_size += BytesPerWord;
__ block_comment("} _captured_state_mask is set");
__ block_comment("} _captured_state_mask_is_set");
}

allocated_frame_size = align_up(allocated_frame_size, StackAlignmentInBytes);
Expand All @@ -184,7 +184,7 @@ void DowncallStubGenerator::generate() {
_frame_complete = __ pc() - start; // frame build complete.

if (_needs_transition) {
__ block_comment("{ thread java2native");
__ block_comment("thread_java2native {");
__ get_PC(Z_R1_scratch);
address the_pc = __ pc();
__ set_last_Java_frame(Z_SP, Z_R1_scratch);
Expand All @@ -194,18 +194,18 @@ void DowncallStubGenerator::generate() {

// State transition
__ set_thread_state(_thread_in_native);
__ block_comment("} thread java2native");
__ block_comment("} thread_java2native");
}
__ block_comment("{ argument shuffle");
__ block_comment("argument_shuffle {");
arg_shuffle.generate(_masm, shuffle_reg, frame::z_jit_out_preserve_size, _abi._shadow_space_bytes, locs);
__ block_comment("} argument shuffle");
__ block_comment("} argument_shuffle");

__ call(as_Register(locs.get(StubLocations::TARGET_ADDRESS)));

//////////////////////////////////////////////////////////////////////////////

if (_captured_state_mask != 0) {
__ block_comment("{ save thread local");
__ block_comment("save_thread_local {");

out_reg_spiller.generate_spill(_masm, spill_offset);

Expand All @@ -216,7 +216,7 @@ void DowncallStubGenerator::generate() {

out_reg_spiller.generate_fill(_masm, spill_offset);

__ block_comment("} save thread local");
__ block_comment("} save_thread_local");
}

//////////////////////////////////////////////////////////////////////////////
Expand All @@ -227,7 +227,7 @@ void DowncallStubGenerator::generate() {
Label L_after_reguard;

if (_needs_transition) {
__ block_comment("{ thread native2java");
__ block_comment("thread_native2java {");
__ set_thread_state(_thread_in_native_trans);

if (!UseSystemMemoryBarrier) {
Expand All @@ -244,14 +244,16 @@ void DowncallStubGenerator::generate() {
// change thread state
__ set_thread_state(_thread_in_Java);

__ block_comment("reguard stack check");
__ z_cli(Address(Z_thread, JavaThread::stack_guard_state_offset() + in_ByteSize(sizeof(StackOverflow::StackGuardState) - 1)),
StackOverflow::stack_guard_yellow_reserved_disabled);
__ block_comment("reguard_stack_check {");
__ z_cli(Address(Z_thread,
JavaThread::stack_guard_state_offset() + in_ByteSize(sizeof(StackOverflow::StackGuardState) - 1)),
StackOverflow::stack_guard_yellow_reserved_disabled);
__ z_bre(L_reguard);
__ block_comment("} reguard_stack_check");
__ bind(L_after_reguard);

__ reset_last_Java_frame();
__ block_comment("} thread native2java");
__ block_comment("} thread_native2java");
}

__ pop_frame();
Expand All @@ -261,7 +263,7 @@ void DowncallStubGenerator::generate() {
//////////////////////////////////////////////////////////////////////////////

if (_needs_transition) {
__ block_comment("{ L_safepoint_poll_slow_path");
__ block_comment("L_safepoint_poll_slow_path {");
__ bind(L_safepoint_poll_slow_path);

// Need to save the native result registers around any runtime calls.
Expand All @@ -277,7 +279,7 @@ void DowncallStubGenerator::generate() {
__ block_comment("} L_safepoint_poll_slow_path");

//////////////////////////////////////////////////////////////////////////////
__ block_comment("{ L_reguard");
__ block_comment("L_reguard {");
__ bind(L_reguard);

// Need to save the native result registers around any runtime calls.
Expand Down
Loading