Skip to content

Commit 80917ca

Browse files
authored
Merge pull request #1966 from SAP/pr-jdk-21.0.8+3
Merge to tag jdk-21.0.8+3
2 parents cb76ba4 + 513f5e7 commit 80917ca

File tree

1,002 files changed

+5720
-5747
lines changed

Some content is hidden

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

1,002 files changed

+5720
-5747
lines changed

make/hotspot/lib/CompileGtest.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
5757
$(GTEST_FRAMEWORK_SRC)/googletest/src \
5858
$(GTEST_FRAMEWORK_SRC)/googlemock/src, \
5959
INCLUDE_FILES := gtest-all.cc gmock-all.cc, \
60-
DISABLED_WARNINGS_gcc := undef unused-result format-nonliteral maybe-uninitialized, \
60+
DISABLED_WARNINGS_gcc := undef unused-result format-nonliteral \
61+
maybe-uninitialized zero-as-null-pointer-constant, \
6162
DISABLED_WARNINGS_clang := undef unused-result format-nonliteral, \
6263
CFLAGS := $(JVM_CFLAGS) \
6364
-I$(GTEST_FRAMEWORK_SRC)/googletest \

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3852,13 +3852,11 @@ void C2_MacroAssembler::count_positives(Register ary1, Register len,
38523852
VM_Version::supports_bmi2()) {
38533853

38543854
Label test_64_loop, test_tail, BREAK_LOOP;
3855-
Register tmp3_aliased = len;
3856-
38573855
movl(tmp1, len);
38583856
vpxor(vec2, vec2, vec2, Assembler::AVX_512bit);
38593857

3860-
andl(tmp1, 64 - 1); // tail count (in chars) 0x3F
3861-
andl(len, ~(64 - 1)); // vector count (in chars)
3858+
andl(tmp1, 0x0000003f); // tail count (in chars) 0x3F
3859+
andl(len, 0xffffffc0); // vector count (in chars)
38623860
jccb(Assembler::zero, test_tail);
38633861

38643862
lea(ary1, Address(ary1, len, Address::times_1));
@@ -3878,12 +3876,17 @@ void C2_MacroAssembler::count_positives(Register ary1, Register len,
38783876
testl(tmp1, -1);
38793877
jcc(Assembler::zero, DONE);
38803878

3879+
3880+
// check the tail for absense of negatives
38813881
// ~(~0 << len) applied up to two times (for 32-bit scenario)
38823882
#ifdef _LP64
3883-
mov64(tmp3_aliased, 0xFFFFFFFFFFFFFFFF);
3884-
shlxq(tmp3_aliased, tmp3_aliased, tmp1);
3885-
notq(tmp3_aliased);
3886-
kmovql(mask2, tmp3_aliased);
3883+
{
3884+
Register tmp3_aliased = len;
3885+
mov64(tmp3_aliased, 0xFFFFFFFFFFFFFFFF);
3886+
shlxq(tmp3_aliased, tmp3_aliased, tmp1);
3887+
notq(tmp3_aliased);
3888+
kmovql(mask2, tmp3_aliased);
3889+
}
38873890
#else
38883891
Label k_init;
38893892
jmp(k_init);
@@ -3915,8 +3918,13 @@ void C2_MacroAssembler::count_positives(Register ary1, Register len,
39153918
ktestq(mask1, mask2);
39163919
jcc(Assembler::zero, DONE);
39173920

3921+
// do a full check for negative registers in the tail
3922+
movl(len, tmp1); // tmp1 holds low 6-bit from original len;
3923+
// ary1 already pointing to the right place
3924+
jmpb(TAIL_START);
3925+
39183926
bind(BREAK_LOOP);
3919-
// At least one byte in the last 64 bytes is negative.
3927+
// At least one byte in the last 64 byte block was negative.
39203928
// Set up to look at the last 64 bytes as if they were a tail
39213929
lea(ary1, Address(ary1, len, Address::times_1));
39223930
addptr(result, len);

src/hotspot/os/bsd/os_bsd.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,9 @@ void os::jfr_report_memory_info() {
25032503
// Send the RSS JFR event
25042504
EventResidentSetSize event;
25052505
event.set_size(info.resident_size);
2506-
event.set_peak(info.resident_size_max);
2506+
// We've seen that resident_size_max sometimes trails resident_size with one page.
2507+
// Make sure we always report size <= peak
2508+
event.set_peak(MAX2(info.resident_size_max, info.resident_size));
25072509
event.commit();
25082510
} else {
25092511
// Log a warning

src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424

2525
#include "precompiled.hpp"
26+
#include "classfile/javaThreadStatus.hpp"
2627
#include "jfr/jfrEvents.hpp"
2728
#include "jfr/recorder/jfrRecorder.hpp"
2829
#include "jfr/periodic/sampling/jfrCallTrace.hpp"
@@ -200,7 +201,7 @@ void OSThreadSampler::protected_task(const SuspendedThreadTaskContext& context)
200201
ev->set_starttime(_suspend_time);
201202
ev->set_endtime(_suspend_time); // fake to not take an end time
202203
ev->set_sampledThread(JfrThreadLocal::thread_id(jt));
203-
ev->set_state(static_cast<u8>(java_lang_Thread::get_thread_status(_thread_oop)));
204+
ev->set_state(static_cast<u8>(JavaThreadStatus::RUNNABLE));
204205
}
205206
}
206207
}
@@ -230,7 +231,7 @@ static void write_native_event(JfrThreadSampleClosure& closure, JavaThread* jt,
230231
EventNativeMethodSample *ev = closure.next_event_native();
231232
ev->set_starttime(JfrTicks::now());
232233
ev->set_sampledThread(JfrThreadLocal::thread_id(jt));
233-
ev->set_state(static_cast<u8>(java_lang_Thread::get_thread_status(thread_oop)));
234+
ev->set_state(static_cast<u8>(JavaThreadStatus::RUNNABLE));
234235
}
235236

236237
void JfrNativeSamplerCallback::call() {

src/hotspot/share/opto/escape.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,7 +2800,7 @@ PhiNode *ConnectionGraph::create_split_phi(PhiNode *orig_phi, int alias_idx, Gro
28002800
// Return a new version of Memory Phi "orig_phi" with the inputs having the
28012801
// specified alias index.
28022802
//
2803-
PhiNode *ConnectionGraph::split_memory_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist) {
2803+
PhiNode *ConnectionGraph::split_memory_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist, uint rec_depth) {
28042804
assert(alias_idx != Compile::AliasIdxBot, "can't split out bottom memory");
28052805
Compile *C = _compile;
28062806
PhaseGVN* igvn = _igvn;
@@ -2816,7 +2816,7 @@ PhiNode *ConnectionGraph::split_memory_phi(PhiNode *orig_phi, int alias_idx, Gro
28162816
bool finished = false;
28172817
while(!finished) {
28182818
while (idx < phi->req()) {
2819-
Node *mem = find_inst_mem(phi->in(idx), alias_idx, orig_phi_worklist);
2819+
Node *mem = find_inst_mem(phi->in(idx), alias_idx, orig_phi_worklist, rec_depth + 1);
28202820
if (mem != nullptr && mem->is_Phi()) {
28212821
PhiNode *newphi = create_split_phi(mem->as_Phi(), alias_idx, orig_phi_worklist, new_phi_created);
28222822
if (new_phi_created) {
@@ -2958,7 +2958,12 @@ void ConnectionGraph::move_inst_mem(Node* n, GrowableArray<PhiNode *> &orig_phi
29582958
// Search memory chain of "mem" to find a MemNode whose address
29592959
// is the specified alias index.
29602960
//
2961-
Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArray<PhiNode *> &orig_phis) {
2961+
#define FIND_INST_MEM_RECURSION_DEPTH_LIMIT 1000
2962+
Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArray<PhiNode *> &orig_phis, uint rec_depth) {
2963+
if (rec_depth > FIND_INST_MEM_RECURSION_DEPTH_LIMIT) {
2964+
_compile->record_failure(_invocation > 0 ? C2Compiler::retry_no_iterative_escape_analysis() : C2Compiler::retry_no_escape_analysis());
2965+
return nullptr;
2966+
}
29622967
if (orig_mem == nullptr) {
29632968
return orig_mem;
29642969
}
@@ -3032,7 +3037,7 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra
30323037
if (result == mmem->base_memory()) {
30333038
// Didn't find instance memory, search through general slice recursively.
30343039
result = mmem->memory_at(C->get_general_index(alias_idx));
3035-
result = find_inst_mem(result, alias_idx, orig_phis);
3040+
result = find_inst_mem(result, alias_idx, orig_phis, rec_depth + 1);
30363041
if (C->failing()) {
30373042
return nullptr;
30383043
}
@@ -3100,7 +3105,7 @@ Node* ConnectionGraph::find_inst_mem(Node *orig_mem, int alias_idx, GrowableArra
31003105
orig_phis.append_if_missing(mphi);
31013106
} else if (C->get_alias_index(t) != alias_idx) {
31023107
// Create a new Phi with the specified alias index type.
3103-
result = split_memory_phi(mphi, alias_idx, orig_phis);
3108+
result = split_memory_phi(mphi, alias_idx, orig_phis, rec_depth + 1);
31043109
}
31053110
}
31063111
// the result is either MemNode, PhiNode, InitializeNode.

src/hotspot/share/opto/escape.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2024, 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
@@ -540,10 +540,10 @@ class ConnectionGraph: public ArenaObj {
540540
bool split_AddP(Node *addp, Node *base);
541541

542542
PhiNode *create_split_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist, bool &new_created);
543-
PhiNode *split_memory_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist);
543+
PhiNode *split_memory_phi(PhiNode *orig_phi, int alias_idx, GrowableArray<PhiNode *> &orig_phi_worklist, uint rec_depth);
544544

545545
void move_inst_mem(Node* n, GrowableArray<PhiNode *> &orig_phis);
546-
Node* find_inst_mem(Node* mem, int alias_idx,GrowableArray<PhiNode *> &orig_phi_worklist);
546+
Node* find_inst_mem(Node* mem, int alias_idx,GrowableArray<PhiNode *> &orig_phi_worklist, uint rec_depth = 0);
547547
Node* step_through_mergemem(MergeMemNode *mmem, int alias_idx, const TypeOopPtr *toop);
548548

549549
Node_Array _node_map; // used for bookkeeping during type splitting

src/hotspot/share/utilities/json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ u_char JSON::skip_line_comment() {
580580
return 0;
581581
}
582582
next();
583-
return next();
583+
return peek();
584584
}
585585

586586
/*

src/java.base/share/classes/java/lang/foreign/AddressLayout.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
/*
2-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
5-
* This code is free software; you can redistribute it and/or modify it
6-
* under the terms of the GNU General Public License version 2 only, as
7-
* published by the Free Software Foundation. Oracle designates this
8-
* particular file as subject to the "Classpath" exception as provided
9-
* by Oracle in the LICENSE file that accompanied this code.
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
1010
*
11-
* This code is distributed in the hope that it will be useful, but WITHOUT
12-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13-
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14-
* version 2 for more details (a copy is included in the LICENSE file that
15-
* accompanied this code).
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
1616
*
17-
* You should have received a copy of the GNU General Public License version
18-
* 2 along with this work; if not, write to the Free Software Foundation,
19-
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20-
*
21-
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22-
* or visit www.oracle.com if you need additional information or have any
23-
* questions.
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2420
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
2524
*/
2625

2726
package java.lang.foreign;

src/java.base/share/classes/java/lang/foreign/FunctionDescriptor.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
3-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2+
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
5-
* This code is free software; you can redistribute it and/or modify it
6-
* under the terms of the GNU General Public License version 2 only, as
7-
* published by the Free Software Foundation. Oracle designates this
8-
* particular file as subject to the "Classpath" exception as provided
9-
* by Oracle in the LICENSE file that accompanied this code.
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
1010
*
11-
* This code is distributed in the hope that it will be useful, but WITHOUT
12-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13-
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14-
* version 2 for more details (a copy is included in the LICENSE file that
15-
* accompanied this code).
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
1616
*
17-
* You should have received a copy of the GNU General Public License version
18-
* 2 along with this work; if not, write to the Free Software Foundation,
19-
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2020
*
21-
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22-
* or visit www.oracle.com if you need additional information or have any
23-
* questions.
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
2424
*/
25+
2526
package java.lang.foreign;
2627

2728
import java.lang.invoke.MethodHandle;

src/java.base/share/classes/java/lang/foreign/GroupLayout.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
/*
2-
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
3-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2+
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
5-
* This code is free software; you can redistribute it and/or modify it
6-
* under the terms of the GNU General Public License version 2 only, as
7-
* published by the Free Software Foundation. Oracle designates this
8-
* particular file as subject to the "Classpath" exception as provided
9-
* by Oracle in the LICENSE file that accompanied this code.
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
1010
*
11-
* This code is distributed in the hope that it will be useful, but WITHOUT
12-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13-
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14-
* version 2 for more details (a copy is included in the LICENSE file that
15-
* accompanied this code).
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
1616
*
17-
* You should have received a copy of the GNU General Public License version
18-
* 2 along with this work; if not, write to the Free Software Foundation,
19-
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20-
*
21-
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22-
* or visit www.oracle.com if you need additional information or have any
23-
* questions.
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2420
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
2524
*/
25+
2626
package java.lang.foreign;
2727

2828
import java.util.List;

src/java.base/share/classes/java/lang/foreign/Linker.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
3-
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4-
*
5-
* This code is free software; you can redistribute it and/or modify it
6-
* under the terms of the GNU General Public License version 2 only, as
7-
* published by the Free Software Foundation. Oracle designates this
8-
* particular file as subject to the "Classpath" exception as provided
9-
* by Oracle in the LICENSE file that accompanied this code.
10-
*
11-
* This code is distributed in the hope that it will be useful, but WITHOUT
12-
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13-
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14-
* version 2 for more details (a copy is included in the LICENSE file that
15-
* accompanied this code).
16-
*
17-
* You should have received a copy of the GNU General Public License version
18-
* 2 along with this work; if not, write to the Free Software Foundation,
19-
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20-
*
21-
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22-
* or visit www.oracle.com if you need additional information or have any
23-
* questions.
24-
*
2+
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
2524
*/
25+
2626
package java.lang.foreign;
2727

2828
import jdk.internal.foreign.abi.AbstractLinker;

0 commit comments

Comments
 (0)