Skip to content

Commit

Permalink
Merge upstream-jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
corretto-github-robot committed Dec 5, 2024
2 parents 1a22589 + e46d822 commit f8a5f35
Show file tree
Hide file tree
Showing 268 changed files with 3,894 additions and 4,143 deletions.
2 changes: 1 addition & 1 deletion make/ModuleWrapper.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ifeq ($(MAKEFILE_PREFIX), Lib)
# which static library files to include. The variable $(MODULE)_INCLUDED_LIBS is
# added to for each call to SetupJdkLibrary. The file module-included-libs.txt is then
# read in StaticLibs.gmk.
ifneq ($($(MODULE)_JDK_LIBS), )
ifneq ($($(MODULE)_INCLUDED_LIBS), )
LIBLIST := $(SUPPORT_OUTPUTDIR)/modules_static-libs/$(MODULE)/module-included-libs.txt

$(LIBLIST): $(TARGETS)
Expand Down
2 changes: 1 addition & 1 deletion make/autoconf/util.m4
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ AC_DEFUN([UTIL_CHECK_TYPE_directory],
if test "[x]ARG_CHECK_FOR_FILES" != "x:"; then
for file in ARG_CHECK_FOR_FILES; do
found_files=$($ECHO $(ls $1/$file 2> /dev/null))
found_files=$($ECHO $($LS -d $1/$file 2> /dev/null))
if test "x$found_files" = x; then
FAILURE="Directory $1 does not contain $file"
break
Expand Down
1 change: 1 addition & 0 deletions make/test/BuildMicrobenchmark.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
SRC := $(MICROBENCHMARK_SRC), \
BIN := $(MICROBENCHMARK_CLASSES), \
JAVAC_FLAGS := \
--add-exports java.base/jdk.internal.classfile.components=ALL-UNNAMED \
--add-exports java.base/jdk.internal.classfile.impl=ALL-UNNAMED \
--add-exports java.base/jdk.internal.event=ALL-UNNAMED \
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register
// Handle existing monitor.
bind(object_has_monitor);

// Try to CAS owner (no owner => current thread's _lock_id).
ldr(rscratch2, Address(rthread, JavaThread::lock_id_offset()));
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
ldr(rscratch2, Address(rthread, JavaThread::monitor_owner_id_offset()));
add(tmp, disp_hdr, (in_bytes(ObjectMonitor::owner_offset())-markWord::monitor_value));
cmpxchg(tmp, zr, rscratch2, Assembler::xword, /*acquire*/ true,
/*release*/ true, /*weak*/ false, tmp3Reg); // Sets flags for result
Expand Down Expand Up @@ -469,8 +469,8 @@ void C2_MacroAssembler::fast_lock_lightweight(Register obj, Register box, Regist
// Compute owner address.
lea(t2_owner_addr, owner_address);

// Try to CAS owner (no owner => current thread's _lock_id).
ldr(rscratch2, Address(rthread, JavaThread::lock_id_offset()));
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
ldr(rscratch2, Address(rthread, JavaThread::monitor_owner_id_offset()));
cmpxchg(t2_owner_addr, zr, rscratch2, Assembler::xword, /*acquire*/ true,
/*release*/ false, /*weak*/ false, t3_owner);
br(Assembler::EQ, monitor_locked);
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2664,10 +2664,10 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register
// Handle existing monitor.
bind(object_has_monitor);

// Try to CAS owner (no owner => current thread's _lock_id).
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
addi(temp, displaced_header, in_bytes(ObjectMonitor::owner_offset()) - markWord::monitor_value);
Register thread_id = displaced_header;
ld(thread_id, in_bytes(JavaThread::lock_id_offset()), R16_thread);
ld(thread_id, in_bytes(JavaThread::monitor_owner_id_offset()), R16_thread);
cmpxchgd(/*flag=*/flag,
/*current_value=*/current_header,
/*compare_value=*/(intptr_t)0,
Expand Down Expand Up @@ -2944,9 +2944,9 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(ConditionRegister fla
addi(owner_addr, monitor, in_bytes(ObjectMonitor::owner_offset()));
}

// Try to CAS owner (no owner => current thread's _lock_id).
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
assert_different_registers(thread_id, monitor, owner_addr, box, R0);
ld(thread_id, in_bytes(JavaThread::lock_id_offset()), R16_thread);
ld(thread_id, in_bytes(JavaThread::monitor_owner_id_offset()), R16_thread);
cmpxchgd(/*flag=*/CCR0,
/*current_value=*/R0,
/*compare_value=*/(intptr_t)0,
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg,
// Handle existing monitor.
bind(object_has_monitor);

// Try to CAS owner (no owner => current thread's _lock_id).
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
add(tmp, disp_hdr, (in_bytes(ObjectMonitor::owner_offset()) - markWord::monitor_value));
Register tid = tmp4Reg;
ld(tid, Address(xthread, JavaThread::lock_id_offset()));
ld(tid, Address(xthread, JavaThread::monitor_owner_id_offset()));
cmpxchg(/*memory address*/tmp, /*expected value*/zr, /*new value*/tid, Assembler::int64,
Assembler::aq, Assembler::rl, /*result*/tmp3Reg); // cas succeeds if tmp3Reg == zr(expected)

Expand Down Expand Up @@ -400,9 +400,9 @@ void C2_MacroAssembler::fast_lock_lightweight(Register obj, Register box,
// Compute owner address.
la(tmp2_owner_addr, owner_address);

// Try to CAS owner (no owner => current thread's _lock_id).
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
Register tid = tmp4;
ld(tid, Address(xthread, JavaThread::lock_id_offset()));
ld(tid, Address(xthread, JavaThread::monitor_owner_id_offset()));
cmpxchg(/*addr*/ tmp2_owner_addr, /*expected*/ zr, /*new*/ tid, Assembler::int64,
/*acquire*/ Assembler::aq, /*release*/ Assembler::relaxed, /*result*/ tmp3_owner);
beqz(tmp3_owner, monitor_locked);
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/cpu/s390/macroAssembler_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3825,11 +3825,11 @@ void MacroAssembler::compiler_fast_lock_object(Register oop, Register box, Regis
Register zero = temp;
Register monitor_tagged = displacedHeader; // Tagged with markWord::monitor_value.

// Try to CAS owner (no owner => current thread's _lock_id).
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
// If csg succeeds then CR=EQ, otherwise, register zero is filled
// with the current owner.
z_lghi(zero, 0);
z_lg(Z_R0_scratch, Address(Z_thread, JavaThread::lock_id_offset()));
z_lg(Z_R0_scratch, Address(Z_thread, JavaThread::monitor_owner_id_offset()));
z_csg(zero, Z_R0_scratch, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), monitor_tagged);

// Store a non-null value into the box.
Expand Down Expand Up @@ -3904,7 +3904,7 @@ void MacroAssembler::compiler_fast_unlock_object(Register oop, Register box, Reg
// Handle existing monitor.
bind(object_has_monitor);

z_lg(Z_R0_scratch, Address(Z_thread, JavaThread::lock_id_offset()));
z_lg(Z_R0_scratch, Address(Z_thread, JavaThread::monitor_owner_id_offset()));
z_cg(Z_R0_scratch, Address(currentHeader, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)));
z_brne(done);

Expand Down Expand Up @@ -6608,11 +6608,11 @@ void MacroAssembler::compiler_fast_lock_lightweight_object(Register obj, Registe
const Address recursions_address(tmp1_monitor, ObjectMonitor::recursions_offset() - monitor_tag);


// Try to CAS owner (no owner => current thread's _lock_id).
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
// If csg succeeds then CR=EQ, otherwise, register zero is filled
// with the current owner.
z_lghi(zero, 0);
z_lg(Z_R0_scratch, Address(Z_thread, JavaThread::lock_id_offset()));
z_lg(Z_R0_scratch, Address(Z_thread, JavaThread::monitor_owner_id_offset()));
z_csg(zero, Z_R0_scratch, owner_address);
z_bre(monitor_locked);

Expand Down
22 changes: 15 additions & 7 deletions src/hotspot/cpu/s390/vm_version_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ unsigned int VM_Version::_Icache_lineSize = DEFAULT

// The following list contains the (approximate) announcement/availability
// dates of the many System z generations in existence as of now.
// Information compiled from https://www.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/TD105503
// Information compiled from https://www.ibm.com/support/pages/ibm-mainframe-life-cycle-history
// z900: 2000-10
// z990: 2003-06
// z9: 2005-09
Expand All @@ -68,12 +68,13 @@ unsigned int VM_Version::_Icache_lineSize = DEFAULT
// z13: 2015-03
// z14: 2017-09
// z15: 2019-09
// z16: 2022-05

static const char* z_gen[] = {" ", "G1", "G2", "G3", "G4", "G5", "G6", "G7", "G8", "G9" };
static const char* z_machine[] = {" ", "2064", "2084", "2094", "2097", "2817", "2827", "2964", "3906", "8561" };
static const char* z_name[] = {" ", "z900", "z990", "z9 EC", "z10 EC", "z196 EC", "ec12", "z13", "z14", "z15" };
static const char* z_WDFM[] = {" ", "2006-06-30", "2008-06-30", "2010-06-30", "2012-06-30", "2014-06-30", "2016-12-31", "2019-06-30", "2021-06-30", "tbd" };
static const char* z_EOS[] = {" ", "2014-12-31", "2014-12-31", "2017-10-31", "2019-12-31", "2021-12-31", "tbd", "tbd", "tbd", "tbd" };
static const char* z_gen[] = {" ", "G1", "G2", "G3", "G4", "G5", "G6", "G7", "G8", "G9", "G10" };
static const char* z_machine[] = {" ", "2064", "2084", "2094", "2097", "2817", "2827", "2964", "3906", "8561", "3931" };
static const char* z_name[] = {" ", "z900", "z990", "z9 EC", "z10 EC", "z196 EC", "ec12", "z13", "z14", "z15", "z16" };
static const char* z_WDFM[] = {" ", "2006-06-30", "2008-06-30", "2010-06-30", "2012-06-30", "2014-06-30", "2016-12-31", "2019-06-30", "2021-06-30", "2024-12-31", "tbd" };
static const char* z_EOS[] = {" ", "2014-12-31", "2014-12-31", "2017-10-31", "2019-12-31", "2021-12-31", "2023-12-31", "2024-12-31", "tbd", "tbd", "tbd" };
static const char* z_features[] = {" ",
"system-z, g1-z900, ldisp",
"system-z, g2-z990, ldisp_fast",
Expand All @@ -83,7 +84,9 @@ static const char* z_features[] = {" ",
"system-z, g6-ec12, ldisp_fast, extimm, pcrel_load/store, cmpb, cond_load/store, interlocked_update, txm",
"system-z, g7-z13, ldisp_fast, extimm, pcrel_load/store, cmpb, cond_load/store, interlocked_update, txm, vectorinstr",
"system-z, g8-z14, ldisp_fast, extimm, pcrel_load/store, cmpb, cond_load/store, interlocked_update, txm, vectorinstr, instrext2, venh1",
"system-z, g9-z15, ldisp_fast, extimm, pcrel_load/store, cmpb, cond_load/store, interlocked_update, txm, vectorinstr, instrext2, venh1, instrext3, venh2"
"system-z, g9-z15, ldisp_fast, extimm, pcrel_load/store, cmpb, cond_load/store, interlocked_update, txm, vectorinstr, instrext2, venh1, instrext3, venh2",
"system-z, g10-z16, ldisp_fast, extimm, pcrel_load/store, cmpb, cond_load/store, interlocked_update, txm, vectorinstr, instrext2, venh1, instrext3, venh2,"
"bear_enh, sort_enh, nnpa_assist, storage_key_removal, vpack_decimal_enh"
};

void VM_Version::initialize() {
Expand Down Expand Up @@ -337,6 +340,11 @@ int VM_Version::get_model_index() {
// is the index of the oldest detected model.
int ambiguity = 0;
int model_ix = 0;
if (is_z16()) {
model_ix = 10;
ambiguity++;
}

if (is_z15()) {
model_ix = 9;
ambiguity++;
Expand Down
27 changes: 21 additions & 6 deletions src/hotspot/cpu/s390/vm_version_s390.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class VM_Version: public Abstract_VM_Version {
#define StoreFacilityListExtendedMask 0x0100000000000000UL // z9
#define ETF2Mask 0x0000800000000000UL // z900
#define CryptoFacilityMask 0x0000400000000000UL // z990 (aka message-security assist)
#define LongDispFacilityMask 0x0000200000000000UL // z900 with microcode update
#define LongDispFacilityHighPerfMask 0x0000300000000000UL // z990
#define LongDispFacilityMask 0x0000200000000000UL // z900 with microcode update, Bit: 18
#define LongDispFacilityHighPerfMask 0x0000100000000000UL // z990, Bit: 19
#define HFPMultiplyAndAddMask 0x0000080000000000UL // z990
#define ExtImmedFacilityMask 0x0000040000000000UL // z9
#define ETF3Mask 0x0000020000000000UL // z990/z9 (?)
Expand All @@ -64,7 +64,8 @@ class VM_Version: public Abstract_VM_Version {
#define ExecuteExtensionsMask 0x0000000010000000UL // z10
#define FPExtensionsMask 0x0000000004000000UL // z196
#define FPSupportEnhancementsMask 0x0000000000400000UL // z10
#define DecimalFloatingPointMask 0x0000000000300000UL // z10
#define DecimalFloatingPointMask 0x0000000000200000UL // z10, Bit: 42
#define DecimalFloatingPointHighPerfMask 0x0000000000100000UL // z10, Bit: 43
// z196 begin
#define DistinctOpndsMask 0x0000000000040000UL // z196
#define FastBCRSerializationMask DistinctOpndsMask
Expand Down Expand Up @@ -114,6 +115,12 @@ class VM_Version: public Abstract_VM_Version {
#define VectorPackedDecimalEnhMask 0x0000008000000000UL // z15
#define CryptoExtension9Mask 0x0000001000000000UL // z15 (aka message-security assist extension 9)
#define DeflateMask 0x0000010000000000UL // z15
#define NNPAssistFacilityMask 0x0000000004000000UL // z16, Neural-network-processing-assist facility, Bit: 165

// ----------------------------------------------
// --- FeatureBitString Bits 193..200 (DW[3]) ---
// ----------------------------------------------
#define BEAREnhFacilityMask 0x4000000000000000UL // z16, BEAR-enhancement facility, Bit: 193

enum {
_max_cache_levels = 8, // As limited by ECAG instruction.
Expand Down Expand Up @@ -179,9 +186,10 @@ class VM_Version: public Abstract_VM_Version {
static bool is_z10() { return has_GnrlInstrExtensions() && !has_DistinctOpnds(); }
static bool is_z196() { return has_DistinctOpnds() && !has_MiscInstrExt(); }
static bool is_ec12() { return has_MiscInstrExt() && !has_CryptoExt5(); }
static bool is_z13() { return has_CryptoExt5() && !has_MiscInstrExt2();}
static bool is_z14() { return has_MiscInstrExt2() && !has_MiscInstrExt3();}
static bool is_z15() { return has_MiscInstrExt3();}
static bool is_z13() { return has_CryptoExt5() && !has_MiscInstrExt2(); }
static bool is_z14() { return has_MiscInstrExt2() && !has_MiscInstrExt3(); }
static bool is_z15() { return has_MiscInstrExt3() && !has_BEAR_Enh_Facility(); }
static bool is_z16() { return has_BEAR_Enh_Facility(); }

// Need to use nested class with unscoped enum.
// C++11 declaration "enum class Cipher { ... } is not supported.
Expand Down Expand Up @@ -455,6 +463,7 @@ class VM_Version: public Abstract_VM_Version {
static bool has_FPExtensions() { return (_features[0] & FPExtensionsMask) == FPExtensionsMask; }
static bool has_FPSupportEnhancements() { return (_features[0] & FPSupportEnhancementsMask) == FPSupportEnhancementsMask; }
static bool has_DecimalFloatingPoint() { return (_features[0] & DecimalFloatingPointMask) == DecimalFloatingPointMask; }
static bool has_DecimalFloatingPointHighPerf() { return (_features[0] & DecimalFloatingPointHighPerfMask) == DecimalFloatingPointHighPerfMask; }
static bool has_InterlockedAccessV1() { return (_features[0] & InterlockedAccess1Mask) == InterlockedAccess1Mask; }
static bool has_LoadAndALUAtomicV1() { return (_features[0] & InterlockedAccess1Mask) == InterlockedAccess1Mask; }
static bool has_PopCount() { return (_features[0] & PopulationCountMask) == PopulationCountMask; }
Expand Down Expand Up @@ -486,6 +495,9 @@ class VM_Version: public Abstract_VM_Version {
static bool has_VectorPackedDecimal() { return (_features[2] & VectorPackedDecimalMask) == VectorPackedDecimalMask; }
static bool has_VectorPackedDecimalEnh() { return (_features[2] & VectorPackedDecimalEnhMask) == VectorPackedDecimalEnhMask; }

static bool has_BEAR_Enh_Facility() { return (_features[3] & BEAREnhFacilityMask) == BEAREnhFacilityMask; }
static bool has_NNP_Assist_Facility() { return (_features[2] & NNPAssistFacilityMask) == NNPAssistFacilityMask; }

// Crypto features query functions.
static bool has_Crypto_AES_GCM128() { return has_Crypto() && test_feature_bit(&_cipher_features_KMA[0], Cipher::_AES128, Cipher::_featureBits); }
static bool has_Crypto_AES_GCM192() { return has_Crypto() && test_feature_bit(&_cipher_features_KMA[0], Cipher::_AES192, Cipher::_featureBits); }
Expand All @@ -508,6 +520,7 @@ class VM_Version: public Abstract_VM_Version {

// CPU feature setters (to force model-specific behaviour). Test/debugging only.
static void set_has_DecimalFloatingPoint() { _features[0] |= DecimalFloatingPointMask; }
static void set_has_DecimalFloatingPointHighPerf() { _features[0] |= DecimalFloatingPointHighPerfMask; }
static void set_has_FPSupportEnhancements() { _features[0] |= FPSupportEnhancementsMask; }
static void set_has_ExecuteExtensions() { _features[0] |= ExecuteExtensionsMask; }
static void set_has_MemWithImmALUOps() { _features[0] |= GnrlInstrExtFacilityMask; }
Expand Down Expand Up @@ -558,6 +571,8 @@ class VM_Version: public Abstract_VM_Version {
static void set_has_VectorEnhancements2() { _features[2] |= VectorEnhancements2Mask; }
static void set_has_VectorPackedDecimal() { _features[2] |= VectorPackedDecimalMask; }
static void set_has_VectorPackedDecimalEnh() { _features[2] |= VectorPackedDecimalEnhMask; }
static void set_has_BEAR_Enh_Facility() { _features[3] |= BEAREnhFacilityMask;}
static void set_has_NNP_Assist_Facility() { _features[2] |= NNPAssistFacilityMask;}

static void reset_has_VectorFacility() { _features[2] &= ~VectorFacilityMask; }

Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void C2_MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmp
movptr(Address(boxReg, 0), checked_cast<int32_t>(markWord::unused_mark().value()));

// It's inflated and we use scrReg for ObjectMonitor* in this section.
movptr(boxReg, Address(r15_thread, JavaThread::lock_id_offset()));
movptr(boxReg, Address(r15_thread, JavaThread::monitor_owner_id_offset()));
movq(scrReg, tmpReg);
xorq(tmpReg, tmpReg);
lock();
Expand Down Expand Up @@ -625,9 +625,9 @@ void C2_MacroAssembler::fast_lock_lightweight(Register obj, Register box, Regist
movptr(Address(box, BasicLock::object_monitor_cache_offset_in_bytes()), monitor);
}

// Try to CAS owner (no owner => current thread's _lock_id).
// Try to CAS owner (no owner => current thread's _monitor_owner_id).
xorptr(rax_reg, rax_reg);
movptr(box, Address(thread, JavaThread::lock_id_offset()));
movptr(box, Address(thread, JavaThread::monitor_owner_id_offset()));
lock(); cmpxchgptr(box, owner_address);
jccb(Assembler::equal, monitor_locked);

Expand Down
Loading

0 comments on commit f8a5f35

Please sign in to comment.