Skip to content

Merge to tag jdk-25+32 #2017

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

Merged
merged 34 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9b99ed8
8361299: (bf) CharBuffer.getChars(int,int,char[],int) violates pre-ex…
Jul 10, 2025
9638050
8360312: Serviceability Agent tests fail with JFR enabled due to unkn…
plummercj Jul 10, 2025
e92f387
8360942: [ubsan] aotCache tests trigger runtime error: applying non-z…
Jul 10, 2025
4d5211c
8357976: GenShen crash in swap_card_tables: Should be clean
Jul 10, 2025
9adc480
8361447: [REDO] Checked version of JNI Release<type>ArrayElements nee…
Jul 11, 2025
44f5dfe
8358183: [JVMCI] crash accessing nmethod::jvmci_name in CodeCache::ag…
Jul 11, 2025
c374ac6
8361615: CodeBuilder::parameterSlot throws undocumented IOOBE
liach Jul 11, 2025
c5d0f1b
8360776: Disable Intel APX by default and enable it with -XX:+UnlockE…
Jul 12, 2025
9f21845
8360775: Fix Shenandoah GC test failures when APX is enabled
Jul 14, 2025
dd82a09
8350177: C2 SuperWord: Integer.numberOfLeadingZeros, numberOfTrailing…
TobiHartmann Jul 14, 2025
20fc8f7
8361529: GenShen: Fix bad assert in swap card tables
Jul 14, 2025
ce85123
8361602: [TESTBUG] serviceability/HeapDump/UnmountedVThreadNativeMeth…
reinrich Jul 15, 2025
7aa3f31
8359678: C2: assert(static_cast<T1>(result) == thing) caused by Rever…
TobiHartmann Jul 15, 2025
d1ea951
8345625: Better HTTP connections
Feb 6, 2025
caac817
8349551: Failures in tests after JDK-8345625
Feb 10, 2025
2555b5a
8348989: Better Glyph drawing
prrace Feb 21, 2025
6e490a4
8349111: Enhance Swing supports
prsadhuk Feb 24, 2025
fae2345
8349584: Improve compiler processing
chhagedorn Mar 3, 2025
3ec6eb6
8349594: Enhance TLS protocol support
driverkt Apr 1, 2025
5ae719c
8350991: Improve HTTP client header handling
Apr 17, 2025
52e1e73
8355884: [macos] java/awt/Frame/I18NTitle.java fails on MacOS
prrace May 5, 2025
121f5a7
8360147: Better Glyph drawing redux
prrace Jun 23, 2025
cf92877
8361905: Problem list serviceability/sa/ClhsdbThreadContext.java on W…
plummercj Jul 15, 2025
03a67a9
8356942: invokeinterface Throws AbstractMethodError Instead of Incomp…
Jul 15, 2025
e1926a6
8361328: cds/appcds/dynamicArchive/TestAutoCreateSharedArchive.java a…
calvinccheung Jul 15, 2025
0e6bf00
Merge
Jul 16, 2025
60196a6
8361952: Installation of MethodData::extra_data_lock() misses synchro…
TobiHartmann Jul 16, 2025
07bb0e3
8362097: JFR: Active Settings view broken
egahlin Jul 16, 2025
533211a
8358621: Reduce busy waiting in worse case at the synchronization poi…
parttimenerd Jul 16, 2025
a626c1d
8358619: Fix interval recomputation in CPU Time Profiler
parttimenerd Jul 16, 2025
b67fb82
8362171: C2 fails with unexpected node in SuperWord truncation: ModI
TobiHartmann Jul 16, 2025
93260d6
8361640: JFR: RandomAccessFile::readLine emits events for each character
egahlin Jul 16, 2025
69ea85e
8361587: AssertionError in File.listFiles() when path is empty and -e…
Jul 16, 2025
5129887
8362250: ARM32: forward_exception_entry missing return address
Jul 17, 2025
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
11 changes: 4 additions & 7 deletions src/hotspot/cpu/arm/arm.ad
Original file line number Diff line number Diff line change
Expand Up @@ -8888,13 +8888,8 @@ instruct TailCalljmpInd(IPRegP jump_target, inline_cache_regP method_ptr) %{
match(TailCall jump_target method_ptr);

ins_cost(CALL_COST);
format %{ "MOV Rexception_pc, LR\n\t"
"jump $jump_target \t! $method_ptr holds method" %}
format %{ "jump $jump_target \t! $method_ptr holds method" %}
ins_encode %{
__ mov(Rexception_pc, LR); // this is used only to call
// StubRoutines::forward_exception_entry()
// which expects PC of exception in
// R5. FIXME?
__ jump($jump_target$$Register);
%}
ins_pipe(tail_call);
Expand Down Expand Up @@ -8939,8 +8934,10 @@ instruct ForwardExceptionjmp()
match(ForwardException);
ins_cost(CALL_COST);

format %{ "b forward_exception_stub" %}
format %{ "MOV Rexception_pc, LR\n\t"
"b forward_exception_entry" %}
ins_encode %{
__ mov(Rexception_pc, LR);
// OK to trash Rtemp, because Rtemp is used by stub
__ jump(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type, Rtemp);
%}
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/cpu/x86/assembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15681,6 +15681,8 @@ void Assembler::pusha_uncached() { // 64bit
// Push pair of original stack pointer along with remaining registers
// at 16B aligned boundary.
push2p(rax, r31);
// Restore the original contents of RAX register.
movq(rax, Address(rax));
push2p(r30, r29);
push2p(r28, r27);
push2p(r26, r25);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,

// The rest is saved with the optimized path

uint num_saved_regs = 4 + (dst != rax ? 1 : 0) + 4;
uint num_saved_regs = 4 + (dst != rax ? 1 : 0) + 4 + (UseAPX ? 16 : 0);
__ subptr(rsp, num_saved_regs * wordSize);
uint slot = num_saved_regs;
if (dst != rax) {
Expand All @@ -367,6 +367,25 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,
__ movptr(Address(rsp, (--slot) * wordSize), r9);
__ movptr(Address(rsp, (--slot) * wordSize), r10);
__ movptr(Address(rsp, (--slot) * wordSize), r11);
// Save APX extended registers r16–r31 if enabled
if (UseAPX) {
__ movptr(Address(rsp, (--slot) * wordSize), r16);
__ movptr(Address(rsp, (--slot) * wordSize), r17);
__ movptr(Address(rsp, (--slot) * wordSize), r18);
__ movptr(Address(rsp, (--slot) * wordSize), r19);
__ movptr(Address(rsp, (--slot) * wordSize), r20);
__ movptr(Address(rsp, (--slot) * wordSize), r21);
__ movptr(Address(rsp, (--slot) * wordSize), r22);
__ movptr(Address(rsp, (--slot) * wordSize), r23);
__ movptr(Address(rsp, (--slot) * wordSize), r24);
__ movptr(Address(rsp, (--slot) * wordSize), r25);
__ movptr(Address(rsp, (--slot) * wordSize), r26);
__ movptr(Address(rsp, (--slot) * wordSize), r27);
__ movptr(Address(rsp, (--slot) * wordSize), r28);
__ movptr(Address(rsp, (--slot) * wordSize), r29);
__ movptr(Address(rsp, (--slot) * wordSize), r30);
__ movptr(Address(rsp, (--slot) * wordSize), r31);
}
// r12-r15 are callee saved in all calling conventions
assert(slot == 0, "must use all slots");

Expand Down Expand Up @@ -398,6 +417,25 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom), arg0, arg1);
}

// Restore APX extended registers r31–r16 if previously saved
if (UseAPX) {
__ movptr(r31, Address(rsp, (slot++) * wordSize));
__ movptr(r30, Address(rsp, (slot++) * wordSize));
__ movptr(r29, Address(rsp, (slot++) * wordSize));
__ movptr(r28, Address(rsp, (slot++) * wordSize));
__ movptr(r27, Address(rsp, (slot++) * wordSize));
__ movptr(r26, Address(rsp, (slot++) * wordSize));
__ movptr(r25, Address(rsp, (slot++) * wordSize));
__ movptr(r24, Address(rsp, (slot++) * wordSize));
__ movptr(r23, Address(rsp, (slot++) * wordSize));
__ movptr(r22, Address(rsp, (slot++) * wordSize));
__ movptr(r21, Address(rsp, (slot++) * wordSize));
__ movptr(r20, Address(rsp, (slot++) * wordSize));
__ movptr(r19, Address(rsp, (slot++) * wordSize));
__ movptr(r18, Address(rsp, (slot++) * wordSize));
__ movptr(r17, Address(rsp, (slot++) * wordSize));
__ movptr(r16, Address(rsp, (slot++) * wordSize));
}
__ movptr(r11, Address(rsp, (slot++) * wordSize));
__ movptr(r10, Address(rsp, (slot++) * wordSize));
__ movptr(r9, Address(rsp, (slot++) * wordSize));
Expand Down
10 changes: 0 additions & 10 deletions src/hotspot/cpu/x86/vm_version_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
__ andl(rax, Address(rbp, in_bytes(VM_Version::xem_xcr0_offset()))); // xcr0 bits apx_f
__ jcc(Assembler::equal, vector_save_restore);

#ifndef PRODUCT
bool save_apx = UseAPX;
VM_Version::set_apx_cpuFeatures();
UseAPX = true;
Expand All @@ -457,7 +456,6 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
__ movq(Address(rsi, 8), r31);

UseAPX = save_apx;
#endif
__ bind(vector_save_restore);
//
// Check if OS has enabled XGETBV instruction to access XCR0
Expand Down Expand Up @@ -1022,8 +1020,6 @@ void VM_Version::get_processor_features() {
if (UseAPX && !apx_supported) {
warning("UseAPX is not supported on this CPU, setting it to false");
FLAG_SET_DEFAULT(UseAPX, false);
} else if (FLAG_IS_DEFAULT(UseAPX)) {
FLAG_SET_DEFAULT(UseAPX, apx_supported ? true : false);
}

if (!UseAPX) {
Expand Down Expand Up @@ -3151,17 +3147,11 @@ bool VM_Version::os_supports_apx_egprs() {
if (!supports_apx_f()) {
return false;
}
// Enable APX support for product builds after
// completion of planned features listed in JDK-8329030.
#if !defined(PRODUCT)
if (_cpuid_info.apx_save[0] != egpr_test_value() ||
_cpuid_info.apx_save[1] != egpr_test_value()) {
return false;
}
return true;
#else
return false;
#endif
}

uint VM_Version::cores_per_cpu() {
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2623,15 +2623,13 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
return Handle_Exception(exceptionInfo, VM_Version::cpuinfo_cont_addr());
}

#if !defined(PRODUCT)
if ((exception_code == EXCEPTION_ACCESS_VIOLATION) &&
VM_Version::is_cpuinfo_segv_addr_apx(pc)) {
// Verify that OS save/restore APX registers.
VM_Version::clear_apx_test_state();
return Handle_Exception(exceptionInfo, VM_Version::cpuinfo_cont_addr_apx());
}
#endif
#endif

#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
if (VMError::was_assert_poison_crash(exception_record)) {
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,11 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
stub = VM_Version::cpuinfo_cont_addr();
}

#if !defined(PRODUCT) && defined(_LP64)
if ((sig == SIGSEGV || sig == SIGBUS) && VM_Version::is_cpuinfo_segv_addr_apx(pc)) {
// Verify that OS save/restore APX registers.
stub = VM_Version::cpuinfo_cont_addr_apx();
VM_Version::clear_apx_test_state();
}
#endif

// We test if stub is already set (by the stack overflow code
// above) so it is not overwritten by the code that follows. This
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,11 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
stub = VM_Version::cpuinfo_cont_addr();
}

#if !defined(PRODUCT) && defined(_LP64)
if ((sig == SIGSEGV) && VM_Version::is_cpuinfo_segv_addr_apx(pc)) {
// Verify that OS save/restore APX registers.
stub = VM_Version::cpuinfo_cont_addr_apx();
VM_Version::clear_apx_test_state();
}
#endif

if (thread->thread_state() == _thread_in_Java) {
// Java thread running in Java code => find exception handler if any
Expand Down
10 changes: 8 additions & 2 deletions src/hotspot/share/code/codeBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size
}
} else {
// We need unique and valid not null address
assert(_mutable_data = blob_end(), "sanity");
assert(_mutable_data == blob_end(), "sanity");
}

set_oop_maps(oop_maps);
Expand All @@ -177,6 +177,7 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, int size, uint16_t heade
_code_offset(_content_offset),
_data_offset(size),
_frame_size(0),
_mutable_data_size(0),
S390_ONLY(_ctable_offset(0) COMMA)
_header_size(header_size),
_frame_complete_offset(CodeOffsets::frame_never_safe),
Expand All @@ -185,7 +186,7 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, int size, uint16_t heade
{
assert(is_aligned(size, oopSize), "unaligned size");
assert(is_aligned(header_size, oopSize), "unaligned size");
assert(_mutable_data = blob_end(), "sanity");
assert(_mutable_data == blob_end(), "sanity");
}

void CodeBlob::restore_mutable_data(address reloc_data) {
Expand All @@ -195,8 +196,11 @@ void CodeBlob::restore_mutable_data(address reloc_data) {
if (_mutable_data == nullptr) {
vm_exit_out_of_memory(_mutable_data_size, OOM_MALLOC_ERROR, "codebuffer: no space for mutable data");
}
} else {
_mutable_data = blob_end(); // default value
}
if (_relocation_size > 0) {
assert(_mutable_data_size > 0, "relocation is part of mutable data section");
memcpy((address)relocation_begin(), reloc_data, relocation_size());
}
}
Expand All @@ -206,6 +210,8 @@ void CodeBlob::purge() {
if (_mutable_data != blob_end()) {
os::free(_mutable_data);
_mutable_data = blob_end(); // Valid not null address
_mutable_data_size = 0;
_relocation_size = 0;
}
if (_oop_maps != nullptr) {
delete _oop_maps;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/code/codeBlob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class CodeBlob {
// Sizes
int size() const { return _size; }
int header_size() const { return _header_size; }
int relocation_size() const { return pointer_delta_as_int((address) relocation_end(), (address) relocation_begin()); }
int relocation_size() const { return _relocation_size; }
int content_size() const { return pointer_delta_as_int(content_end(), content_begin()); }
int code_size() const { return pointer_delta_as_int(code_end(), code_begin()); }

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/code/nmethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,7 @@ void nmethod::purge(bool unregister_nmethod) {
}
CodeCache::unregister_old_nmethod(this);

JVMCI_ONLY( _metadata_size = 0; )
CodeBlob::purge();
}

Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,6 @@ void ShenandoahConcurrentGC::entry_reset() {
msg);
op_reset();
}

if (heap->mode()->is_generational()) {
heap->old_generation()->card_scan()->mark_read_table_as_clean();
}
}

void ShenandoahConcurrentGC::entry_scan_remembered_set() {
Expand Down Expand Up @@ -644,6 +640,10 @@ void ShenandoahConcurrentGC::op_reset() {
} else {
_generation->prepare_gc();
}

if (heap->mode()->is_generational()) {
heap->old_generation()->card_scan()->mark_read_table_as_clean();
}
}

class ShenandoahInitMarkUpdateRegionStateClosure : public ShenandoahHeapRegionClosure {
Expand Down
12 changes: 9 additions & 3 deletions src/hotspot/share/gc/shenandoah/shenandoahDegeneratedGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,15 @@ void ShenandoahDegenGC::op_degenerated() {
heap->set_unload_classes(_generation->heuristics()->can_unload_classes() &&
(!heap->mode()->is_generational() || _generation->is_global()));

if (heap->mode()->is_generational() && _generation->is_young()) {
// Swap remembered sets for young
_generation->swap_card_tables();
if (heap->mode()->is_generational()) {
// Clean the read table before swapping it. The end goal here is to have a clean
// write table, and to have the read table updated with the previous write table.
heap->old_generation()->card_scan()->mark_read_table_as_clean();

if (_generation->is_young()) {
// Swap remembered sets for young
_generation->swap_card_tables();
}
}

case _degenerated_roots:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ void ShenandoahDirectCardMarkRememberedSet::swap_card_tables() {

#ifdef ASSERT
CardValue* start_bp = &(_card_table->write_byte_map())[0];
CardValue* end_bp = &(new_ptr)[_card_table->last_valid_index()];
CardValue* end_bp = &(start_bp[_card_table->last_valid_index()]);

while (start_bp <= end_bp) {
assert(*start_bp == CardTable::clean_card_val(), "Should be clean: " PTR_FORMAT, p2i(start_bp));
Expand Down
10 changes: 8 additions & 2 deletions src/hotspot/share/jfr/jni/jfrJniMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,15 @@ NO_TRANSITION(jboolean, jfr_set_throttle(JNIEnv* env, jclass jvm, jlong event_ty
return JNI_TRUE;
NO_TRANSITION_END

JVM_ENTRY_NO_ENV(void, jfr_set_cpu_throttle(JNIEnv* env, jclass jvm, jdouble rate, jboolean auto_adapt))
JVM_ENTRY_NO_ENV(void, jfr_set_cpu_rate(JNIEnv* env, jclass jvm, jdouble rate))
JfrEventSetting::set_enabled(JfrCPUTimeSampleEvent, rate > 0);
JfrCPUTimeThreadSampling::set_rate(rate, auto_adapt == JNI_TRUE);
JfrCPUTimeThreadSampling::set_rate(rate);
JVM_END

JVM_ENTRY_NO_ENV(void, jfr_set_cpu_period(JNIEnv* env, jclass jvm, jlong period_nanos))
assert(period_nanos >= 0, "invariant");
JfrEventSetting::set_enabled(JfrCPUTimeSampleEvent, period_nanos > 0);
JfrCPUTimeThreadSampling::set_period(period_nanos);
JVM_END

NO_TRANSITION(void, jfr_set_miscellaneous(JNIEnv* env, jclass jvm, jlong event_type_id, jlong value))
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/jfr/jni/jfrJniMethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ jlong JNICALL jfr_get_unloaded_event_classes_count(JNIEnv* env, jclass jvm);

jboolean JNICALL jfr_set_throttle(JNIEnv* env, jclass jvm, jlong event_type_id, jlong event_sample_size, jlong period_ms);

void JNICALL jfr_set_cpu_throttle(JNIEnv* env, jclass jvm, jdouble rate, jboolean auto_adapt);
void JNICALL jfr_set_cpu_rate(JNIEnv* env, jclass jvm, jdouble rate);

void JNICALL jfr_set_cpu_period(JNIEnv* env, jclass jvm, jlong period_nanos);

void JNICALL jfr_set_miscellaneous(JNIEnv* env, jclass jvm, jlong id, jlong value);

Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ JfrJniMethodRegistration::JfrJniMethodRegistration(JNIEnv* env) {
(char*)"getUnloadedEventClassCount", (char*)"()J", (void*)jfr_get_unloaded_event_classes_count,
(char*)"setMiscellaneous", (char*)"(JJ)V", (void*)jfr_set_miscellaneous,
(char*)"setThrottle", (char*)"(JJJ)Z", (void*)jfr_set_throttle,
(char*)"setCPUThrottle", (char*)"(DZ)V", (void*)jfr_set_cpu_throttle,
(char*)"setCPURate", (char*)"(D)V", (void*)jfr_set_cpu_rate,
(char*)"setCPUPeriod", (char*)"(J)V", (void*)jfr_set_cpu_period,
(char*)"emitOldObjectSamples", (char*)"(JZZ)V", (void*)jfr_emit_old_object_samples,
(char*)"shouldRotateDisk", (char*)"()Z", (void*)jfr_should_rotate_disk,
(char*)"exclude", (char*)"(Ljava/lang/Thread;)V", (void*)jfr_exclude_thread,
Expand Down
Loading
Loading