Skip to content

Commit e9eb8fb

Browse files
Merge branch 'master' into 8311530-depr-jsobject
2 parents 7afc50c + 236c71c commit e9eb8fb

File tree

760 files changed

+26868
-5492
lines changed

Some content is hidden

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

760 files changed

+26868
-5492
lines changed

make/autoconf/jvm-features.m4

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,22 @@ AC_DEFUN([JVM_FEATURES_CALCULATE_ACTIVE],
479479
$JVM_FEATURES_ENABLED, $JVM_FEATURES_DISABLED)
480480
])
481481

482+
################################################################################
483+
# Filter the unsupported feature combinations.
484+
# This is called after JVM_FEATURES_ACTIVE are fully populated.
485+
#
486+
AC_DEFUN([JVM_FEATURES_FILTER_UNSUPPORTED],
487+
[
488+
# G1 late barrier expansion in C2 is not implemented for some platforms.
489+
# Choose not to support G1 in this configuration.
490+
if JVM_FEATURES_IS_ACTIVE(compiler2); then
491+
if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
492+
AC_MSG_NOTICE([G1 cannot be used with C2 on this platform, disabling G1])
493+
UTIL_GET_NON_MATCHING_VALUES(JVM_FEATURES_ACTIVE, $JVM_FEATURES_ACTIVE, "g1gc")
494+
fi
495+
fi
496+
])
497+
482498
################################################################################
483499
# Helper function for JVM_FEATURES_VERIFY. Check if the specified JVM
484500
# feature is active. To be used in shell if constructs, like this:
@@ -554,6 +570,9 @@ AC_DEFUN_ONCE([JVM_FEATURES_SETUP],
554570
# The result is stored in JVM_FEATURES_ACTIVE.
555571
JVM_FEATURES_CALCULATE_ACTIVE($variant)
556572
573+
# Filter unsupported feature combinations from JVM_FEATURES_ACTIVE.
574+
JVM_FEATURES_FILTER_UNSUPPORTED
575+
557576
# Verify consistency for JVM_FEATURES_ACTIVE.
558577
JVM_FEATURES_VERIFY($variant)
559578

make/autoconf/toolchain.m4

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
307307
[
308308
# Restore old path, except for the microsoft toolchain, which requires the
309309
# toolchain path to remain in place. Otherwise the compiler will not work in
310-
# some siutations in later configure checks.
310+
# some situations in later configure checks.
311311
if test "x$TOOLCHAIN_TYPE" != "xmicrosoft"; then
312312
PATH="$OLD_PATH"
313313
fi
@@ -316,10 +316,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
316316
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
317317
CFLAGS="$ORG_CFLAGS"
318318
CXXFLAGS="$ORG_CXXFLAGS"
319-
320-
# filter out some unwanted additions autoconf may add to CXX; we saw this on macOS with autoconf 2.72
321-
UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11)
322-
CXX="$cxx_filtered"
323319
])
324320

325321
# Check if a compiler is of the toolchain type we expect, and save the version
@@ -358,6 +354,11 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
358354
# Copyright (C) 2013 Free Software Foundation, Inc.
359355
# This is free software; see the source for copying conditions. There is NO
360356
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
357+
# or look like
358+
# gcc (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32)
359+
# Copyright (C) 2020 Free Software Foundation, Inc.
360+
# This is free software; see the source for copying conditions. There is NO
361+
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
361362
COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1`
362363
# Check that this is likely to be GCC.
363364
$ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null
@@ -371,7 +372,8 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION],
371372
COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \
372373
$SED -e 's/ *Copyright .*//'`
373374
COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
374-
$SED -e 's/^.* \(@<:@1-9@:>@<:@0-9@:>@*\.@<:@0-9.@:>@*\)@<:@^0-9.@:>@.*$/\1/'`
375+
$AWK -F ')' '{print [$]2}' | \
376+
$AWK '{print [$]1}'`
375377
elif test "x$TOOLCHAIN_TYPE" = xclang; then
376378
# clang --version output typically looks like
377379
# Apple clang version 15.0.0 (clang-1500.3.9.4)

make/autoconf/util.m4

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,70 @@
2525

2626
m4_include([util_paths.m4])
2727

28+
###############################################################################
29+
# Overwrite the existing version of AC_PROG_CC with our own custom variant.
30+
# Unlike the regular AC_PROG_CC, the compiler list must always be passed.
31+
AC_DEFUN([AC_PROG_CC],
32+
[
33+
AC_LANG_PUSH(C)
34+
AC_ARG_VAR([CC], [C compiler command])
35+
AC_ARG_VAR([CFLAGS], [C compiler flags])
36+
37+
_AC_ARG_VAR_LDFLAGS()
38+
_AC_ARG_VAR_LIBS()
39+
_AC_ARG_VAR_CPPFLAGS()
40+
41+
AC_CHECK_TOOLS(CC, [$1])
42+
43+
test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH])
44+
45+
# Provide some information about the compiler.
46+
_AS_ECHO_LOG([checking for _AC_LANG compiler version])
47+
set X $ac_compile
48+
ac_compiler=$[2]
49+
for ac_option in --version -v -V -qversion -version; do
50+
_AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
51+
done
52+
53+
m4_expand_once([_AC_COMPILER_EXEEXT])
54+
m4_expand_once([_AC_COMPILER_OBJEXT])
55+
56+
_AC_PROG_CC_G
57+
58+
AC_LANG_POP(C)
59+
])
60+
61+
###############################################################################
62+
# Overwrite the existing version of AC_PROG_CXX with our own custom variant.
63+
# Unlike the regular AC_PROG_CXX, the compiler list must always be passed.
64+
AC_DEFUN([AC_PROG_CXX],
65+
[
66+
AC_LANG_PUSH(C++)
67+
AC_ARG_VAR([CXX], [C++ compiler command])
68+
AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])
69+
70+
_AC_ARG_VAR_LDFLAGS()
71+
_AC_ARG_VAR_LIBS()
72+
_AC_ARG_VAR_CPPFLAGS()
73+
74+
AC_CHECK_TOOLS(CXX, [$1])
75+
76+
# Provide some information about the compiler.
77+
_AS_ECHO_LOG([checking for _AC_LANG compiler version])
78+
set X $ac_compile
79+
ac_compiler=$[2]
80+
for ac_option in --version -v -V -qversion; do
81+
_AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD])
82+
done
83+
84+
m4_expand_once([_AC_COMPILER_EXEEXT])
85+
m4_expand_once([_AC_COMPILER_OBJEXT])
86+
87+
_AC_PROG_CXX_G
88+
89+
AC_LANG_POP(C++)
90+
])
91+
2892
################################################################################
2993
# Create a function/macro that takes a series of named arguments. The call is
3094
# similar to AC_DEFUN, but the setup of the function looks like this:

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
5959
OPTIMIZATION := HIGH, \
6060
EXTRA_HEADER_DIRS := java.base:libjvm, \
6161
DISABLED_WARNINGS_gcc := sign-compare, \
62-
DISABLED_WARNINGS_gcc_LinuxDebuggerLocal.cpp := unused-variable, \
6362
DISABLED_WARNINGS_gcc_ps_core.c := pointer-arith, \
64-
DISABLED_WARNINGS_gcc_symtab.c := unused-but-set-variable, \
6563
DISABLED_WARNINGS_clang := sign-compare, \
6664
DISABLED_WARNINGS_clang_libproc_impl.c := format-nonliteral, \
6765
DISABLED_WARNINGS_clang_MacosxDebuggerLocal.m := unused-variable, \

make/test/JtregNativeJdk.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ ifeq ($(call isTargetOs, linux), true)
115115
# stripping during the test libraries' build.
116116
BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libFib := -g
117117
BUILD_JDK_JTREG_LIBRARIES_STRIP_SYMBOLS_libFib := false
118+
# nio tests' libCreationTimeHelper native needs -ldl linker flag
119+
BUILD_JDK_JTREG_LIBRARIES_LDFLAGS_libCreationTimeHelper := -ldl
118120
endif
119121

120122
ifeq ($(ASAN_ENABLED), true)

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2307,10 +2307,6 @@ const RegMask* Matcher::predicate_reg_mask(void) {
23072307
return &_PR_REG_mask;
23082308
}
23092309

2310-
const TypeVectMask* Matcher::predicate_reg_type(const Type* elemTy, int length) {
2311-
return new TypeVectMask(elemTy, length);
2312-
}
2313-
23142310
// Vector calling convention not yet implemented.
23152311
bool Matcher::supports_vector_calling_convention(void) {
23162312
return false;
@@ -6892,36 +6888,6 @@ instruct loadConD(vRegD dst, immD con) %{
68926888

68936889
// Store Instructions
68946890

6895-
// Store CMS card-mark Immediate
6896-
instruct storeimmCM0(immI0 zero, memory1 mem)
6897-
%{
6898-
match(Set mem (StoreCM mem zero));
6899-
6900-
ins_cost(INSN_COST);
6901-
format %{ "storestore (elided)\n\t"
6902-
"strb zr, $mem\t# byte" %}
6903-
6904-
ins_encode(aarch64_enc_strb0(mem));
6905-
6906-
ins_pipe(istore_mem);
6907-
%}
6908-
6909-
// Store CMS card-mark Immediate with intervening StoreStore
6910-
// needed when using CMS with no conditional card marking
6911-
instruct storeimmCM0_ordered(immI0 zero, memory1 mem)
6912-
%{
6913-
match(Set mem (StoreCM mem zero));
6914-
6915-
ins_cost(INSN_COST * 2);
6916-
format %{ "storestore\n\t"
6917-
"dmb ishst"
6918-
"\n\tstrb zr, $mem\t# byte" %}
6919-
6920-
ins_encode(aarch64_enc_strb0_ordered(mem));
6921-
6922-
ins_pipe(istore_mem);
6923-
%}
6924-
69256891
// Store Byte
69266892
instruct storeB(iRegIorL2I src, memory1 mem)
69276893
%{

src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,8 @@ void ZBarrierSetAssembler::generate_c2_store_barrier_stub(MacroAssembler* masm,
11891189
__ lea(rscratch1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_native_oop_field_without_healing_addr()));
11901190
} else if (stub->is_atomic()) {
11911191
__ lea(rscratch1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_oop_field_with_healing_addr()));
1192+
} else if (stub->is_nokeepalive()) {
1193+
__ lea(rscratch1, RuntimeAddress(ZBarrierSetRuntime::no_keepalive_store_barrier_on_oop_field_without_healing_addr()));
11921194
} else {
11931195
__ lea(rscratch1, RuntimeAddress(ZBarrierSetRuntime::store_barrier_on_oop_field_without_healing_addr()));
11941196
}
@@ -1307,11 +1309,11 @@ Label* ZLoadBarrierStubC2Aarch64::entry() {
13071309
return ZBarrierStubC2::entry();
13081310
}
13091311

1310-
ZStoreBarrierStubC2Aarch64::ZStoreBarrierStubC2Aarch64(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic)
1311-
: ZStoreBarrierStubC2(node, ref_addr, new_zaddress, new_zpointer, is_native, is_atomic), _deferred_emit(false) {}
1312+
ZStoreBarrierStubC2Aarch64::ZStoreBarrierStubC2Aarch64(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic, bool is_nokeepalive)
1313+
: ZStoreBarrierStubC2(node, ref_addr, new_zaddress, new_zpointer, is_native, is_atomic, is_nokeepalive), _deferred_emit(false) {}
13121314

1313-
ZStoreBarrierStubC2Aarch64* ZStoreBarrierStubC2Aarch64::create(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic) {
1314-
ZStoreBarrierStubC2Aarch64* const stub = new (Compile::current()->comp_arena()) ZStoreBarrierStubC2Aarch64(node, ref_addr, new_zaddress, new_zpointer, is_native, is_atomic);
1315+
ZStoreBarrierStubC2Aarch64* ZStoreBarrierStubC2Aarch64::create(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic, bool is_nokeepalive) {
1316+
ZStoreBarrierStubC2Aarch64* const stub = new (Compile::current()->comp_arena()) ZStoreBarrierStubC2Aarch64(node, ref_addr, new_zaddress, new_zpointer, is_native, is_atomic, is_nokeepalive);
13151317
register_stub(stub);
13161318
return stub;
13171319
}

src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ class ZStoreBarrierStubC2Aarch64 : public ZStoreBarrierStubC2 {
280280
private:
281281
bool _deferred_emit;
282282

283-
ZStoreBarrierStubC2Aarch64(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic);
283+
ZStoreBarrierStubC2Aarch64(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic, bool is_nokeepalive);
284284

285285
public:
286-
static ZStoreBarrierStubC2Aarch64* create(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic);
286+
static ZStoreBarrierStubC2Aarch64* create(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic, bool is_nokeepalive);
287287

288288
virtual void emit_code(MacroAssembler& masm);
289289
};

src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ static void z_store_barrier(MacroAssembler* masm, const MachNode* node, Address
9191
z_color(masm, node, rnew_zpointer, rnew_zaddress);
9292
} else {
9393
bool is_native = (node->barrier_data() & ZBarrierNative) != 0;
94-
ZStoreBarrierStubC2Aarch64* const stub = ZStoreBarrierStubC2Aarch64::create(node, ref_addr, rnew_zaddress, rnew_zpointer, is_native, is_atomic);
94+
bool is_nokeepalive = (node->barrier_data() & ZBarrierNoKeepalive) != 0;
95+
ZStoreBarrierStubC2Aarch64* const stub = ZStoreBarrierStubC2Aarch64::create(node, ref_addr, rnew_zaddress, rnew_zpointer, is_native, is_atomic, is_nokeepalive);
9596
ZBarrierSetAssembler* bs_asm = ZBarrierSet::assembler();
9697
bs_asm->store_barrier_fast(masm, ref_addr, rnew_zaddress, rnew_zpointer, tmp, true /* in_nmethod */, is_atomic, *stub->entry(), *stub->continuation());
9798
}

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5011,8 +5011,10 @@ void MacroAssembler::decode_heap_oop(Register d, Register s) {
50115011
verify_heapbase("MacroAssembler::decode_heap_oop: heap base corrupted?");
50125012
#endif
50135013
if (CompressedOops::base() == nullptr) {
5014-
if (CompressedOops::shift() != 0 || d != s) {
5014+
if (CompressedOops::shift() != 0) {
50155015
lsl(d, s, CompressedOops::shift());
5016+
} else if (d != s) {
5017+
mov(d, s);
50165018
}
50175019
} else {
50185020
Label done;

src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ address NativeCall::destination() const {
7878
//
7979
// Used in the runtime linkage of calls; see class CompiledIC.
8080
void NativeCall::set_destination_mt_safe(address dest) {
81-
assert((Patching_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
81+
assert((CodeCache_lock->is_locked() || SafepointSynchronize::is_at_safepoint()) ||
8282
CompiledICLocker::is_safe(addr_at(0)),
8383
"concurrent code patching");
8484

src/hotspot/cpu/arm/arm.ad

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,10 +1003,6 @@ const RegMask* Matcher::predicate_reg_mask(void) {
10031003
return nullptr;
10041004
}
10051005

1006-
const TypeVectMask* Matcher::predicate_reg_type(const Type* elemTy, int length) {
1007-
return nullptr;
1008-
}
1009-
10101006
// Vector calling convention not yet implemented.
10111007
bool Matcher::supports_vector_calling_convention(void) {
10121008
return false;
@@ -4226,18 +4222,6 @@ instruct storeB(memoryB mem, store_RegI src) %{
42264222
ins_pipe(istore_mem_reg);
42274223
%}
42284224

4229-
instruct storeCM(memoryB mem, store_RegI src) %{
4230-
match(Set mem (StoreCM mem src));
4231-
ins_cost(MEMORY_REF_COST);
4232-
4233-
size(4);
4234-
format %{ "STRB $src,$mem\t! CMS card-mark byte" %}
4235-
ins_encode %{
4236-
__ strb($src$$Register, $mem$$Address);
4237-
%}
4238-
ins_pipe(istore_mem_reg);
4239-
%}
4240-
42414225
// Store Char/Short
42424226

42434227

src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ int LIR_Assembler::emit_unwind_handler() {
213213
if (method()->is_synchronized()) {
214214
monitor_address(0, FrameMap::R4_opr);
215215
stub = new MonitorExitStub(FrameMap::R4_opr, true, 0);
216-
__ unlock_object(R5, R6, R4, *stub->entry());
216+
if (LockingMode == LM_MONITOR) {
217+
__ b(*stub->entry());
218+
} else {
219+
__ unlock_object(R5, R6, R4, *stub->entry());
220+
}
217221
__ bind(*stub->continuation());
218222
}
219223

src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox
114114
/*check without membar and ldarx first*/true);
115115
// If compare/exchange succeeded we found an unlocked object and we now have locked it
116116
// hence we are done.
117+
} else {
118+
assert(false, "Unhandled LockingMode:%d", LockingMode);
117119
}
118120
b(done);
119121

@@ -168,6 +170,8 @@ void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rb
168170
MacroAssembler::cmpxchgx_hint_release_lock(),
169171
noreg,
170172
&slow_int);
173+
} else {
174+
assert(false, "Unhandled LockingMode:%d", LockingMode);
171175
}
172176
b(done);
173177
bind(slow_int);

src/hotspot/cpu/ppc/gc/z/zBarrierSetAssembler_ppc.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,8 @@ void ZBarrierSetAssembler::generate_c2_store_barrier_stub(MacroAssembler* masm,
943943
__ call_VM_leaf(ZBarrierSetRuntime::store_barrier_on_native_oop_field_without_healing_addr(), R3_ARG1);
944944
} else if (stub->is_atomic()) {
945945
__ call_VM_leaf(ZBarrierSetRuntime::store_barrier_on_oop_field_with_healing_addr(), R3_ARG1);
946+
} else if (stub->is_nokeepalive()) {
947+
__ call_VM_leaf(ZBarrierSetRuntime::no_keepalive_store_barrier_on_oop_field_without_healing_addr(), R3_ARG1);
946948
} else {
947949
__ call_VM_leaf(ZBarrierSetRuntime::store_barrier_on_oop_field_without_healing_addr(), R3_ARG1);
948950
}

src/hotspot/cpu/ppc/gc/z/z_ppc.ad

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ static void z_store_barrier(MacroAssembler* masm, const MachNode* node, Register
8383
z_color(masm, rnew_zpointer, rnew_zaddress);
8484
} else {
8585
bool is_native = (node->barrier_data() & ZBarrierNative) != 0;
86-
ZStoreBarrierStubC2* const stub = ZStoreBarrierStubC2::create(node, Address(ref_base, disp), rnew_zaddress, rnew_zpointer, is_native, is_atomic);
86+
bool is_nokeepalive = (node->barrier_data() & ZBarrierNoKeepalive) != 0;
87+
ZStoreBarrierStubC2* const stub = ZStoreBarrierStubC2::create(node, Address(ref_base, disp), rnew_zaddress, rnew_zpointer, is_native, is_atomic, is_nokeepalive);
8788
ZBarrierSetAssembler* bs_asm = ZBarrierSet::assembler();
8889
bs_asm->store_barrier_fast(masm, ref_base, disp, rnew_zaddress, rnew_zpointer, true /* in_nmethod */, is_atomic, *stub->entry(), *stub->continuation());
8990
}

0 commit comments

Comments
 (0)