Skip to content

Commit 987af5a

Browse files
author
Rob McKenna
committed
Merge
2 parents db62309 + e8f2cd8 commit 987af5a

File tree

75 files changed

+1828
-402
lines changed

Some content is hidden

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

75 files changed

+1828
-402
lines changed

src/hotspot/cpu/arm/arm.ad

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8888,13 +8888,8 @@ instruct TailCalljmpInd(IPRegP jump_target, inline_cache_regP method_ptr) %{
88888888
match(TailCall jump_target method_ptr);
88898889

88908890
ins_cost(CALL_COST);
8891-
format %{ "MOV Rexception_pc, LR\n\t"
8892-
"jump $jump_target \t! $method_ptr holds method" %}
8891+
format %{ "jump $jump_target \t! $method_ptr holds method" %}
88938892
ins_encode %{
8894-
__ mov(Rexception_pc, LR); // this is used only to call
8895-
// StubRoutines::forward_exception_entry()
8896-
// which expects PC of exception in
8897-
// R5. FIXME?
88988893
__ jump($jump_target$$Register);
88998894
%}
89008895
ins_pipe(tail_call);
@@ -8939,8 +8934,10 @@ instruct ForwardExceptionjmp()
89398934
match(ForwardException);
89408935
ins_cost(CALL_COST);
89418936

8942-
format %{ "b forward_exception_stub" %}
8937+
format %{ "MOV Rexception_pc, LR\n\t"
8938+
"b forward_exception_entry" %}
89438939
ins_encode %{
8940+
__ mov(Rexception_pc, LR);
89448941
// OK to trash Rtemp, because Rtemp is used by stub
89458942
__ jump(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type, Rtemp);
89468943
%}

src/hotspot/cpu/x86/assembler_x86.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15681,6 +15681,8 @@ void Assembler::pusha_uncached() { // 64bit
1568115681
// Push pair of original stack pointer along with remaining registers
1568215682
// at 16B aligned boundary.
1568315683
push2p(rax, r31);
15684+
// Restore the original contents of RAX register.
15685+
movq(rax, Address(rax));
1568415686
push2p(r30, r29);
1568515687
push2p(r28, r27);
1568615688
push2p(r26, r25);

src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,
353353

354354
// The rest is saved with the optimized path
355355

356-
uint num_saved_regs = 4 + (dst != rax ? 1 : 0) + 4;
356+
uint num_saved_regs = 4 + (dst != rax ? 1 : 0) + 4 + (UseAPX ? 16 : 0);
357357
__ subptr(rsp, num_saved_regs * wordSize);
358358
uint slot = num_saved_regs;
359359
if (dst != rax) {
@@ -367,6 +367,25 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler* masm,
367367
__ movptr(Address(rsp, (--slot) * wordSize), r9);
368368
__ movptr(Address(rsp, (--slot) * wordSize), r10);
369369
__ movptr(Address(rsp, (--slot) * wordSize), r11);
370+
// Save APX extended registers r16–r31 if enabled
371+
if (UseAPX) {
372+
__ movptr(Address(rsp, (--slot) * wordSize), r16);
373+
__ movptr(Address(rsp, (--slot) * wordSize), r17);
374+
__ movptr(Address(rsp, (--slot) * wordSize), r18);
375+
__ movptr(Address(rsp, (--slot) * wordSize), r19);
376+
__ movptr(Address(rsp, (--slot) * wordSize), r20);
377+
__ movptr(Address(rsp, (--slot) * wordSize), r21);
378+
__ movptr(Address(rsp, (--slot) * wordSize), r22);
379+
__ movptr(Address(rsp, (--slot) * wordSize), r23);
380+
__ movptr(Address(rsp, (--slot) * wordSize), r24);
381+
__ movptr(Address(rsp, (--slot) * wordSize), r25);
382+
__ movptr(Address(rsp, (--slot) * wordSize), r26);
383+
__ movptr(Address(rsp, (--slot) * wordSize), r27);
384+
__ movptr(Address(rsp, (--slot) * wordSize), r28);
385+
__ movptr(Address(rsp, (--slot) * wordSize), r29);
386+
__ movptr(Address(rsp, (--slot) * wordSize), r30);
387+
__ movptr(Address(rsp, (--slot) * wordSize), r31);
388+
}
370389
// r12-r15 are callee saved in all calling conventions
371390
assert(slot == 0, "must use all slots");
372391

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

420+
// Restore APX extended registers r31–r16 if previously saved
421+
if (UseAPX) {
422+
__ movptr(r31, Address(rsp, (slot++) * wordSize));
423+
__ movptr(r30, Address(rsp, (slot++) * wordSize));
424+
__ movptr(r29, Address(rsp, (slot++) * wordSize));
425+
__ movptr(r28, Address(rsp, (slot++) * wordSize));
426+
__ movptr(r27, Address(rsp, (slot++) * wordSize));
427+
__ movptr(r26, Address(rsp, (slot++) * wordSize));
428+
__ movptr(r25, Address(rsp, (slot++) * wordSize));
429+
__ movptr(r24, Address(rsp, (slot++) * wordSize));
430+
__ movptr(r23, Address(rsp, (slot++) * wordSize));
431+
__ movptr(r22, Address(rsp, (slot++) * wordSize));
432+
__ movptr(r21, Address(rsp, (slot++) * wordSize));
433+
__ movptr(r20, Address(rsp, (slot++) * wordSize));
434+
__ movptr(r19, Address(rsp, (slot++) * wordSize));
435+
__ movptr(r18, Address(rsp, (slot++) * wordSize));
436+
__ movptr(r17, Address(rsp, (slot++) * wordSize));
437+
__ movptr(r16, Address(rsp, (slot++) * wordSize));
438+
}
401439
__ movptr(r11, Address(rsp, (slot++) * wordSize));
402440
__ movptr(r10, Address(rsp, (slot++) * wordSize));
403441
__ movptr(r9, Address(rsp, (slot++) * wordSize));

src/hotspot/cpu/x86/vm_version_x86.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,6 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
440440
__ andl(rax, Address(rbp, in_bytes(VM_Version::xem_xcr0_offset()))); // xcr0 bits apx_f
441441
__ jcc(Assembler::equal, vector_save_restore);
442442

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

459458
UseAPX = save_apx;
460-
#endif
461459
__ bind(vector_save_restore);
462460
//
463461
// Check if OS has enabled XGETBV instruction to access XCR0
@@ -1022,8 +1020,6 @@ void VM_Version::get_processor_features() {
10221020
if (UseAPX && !apx_supported) {
10231021
warning("UseAPX is not supported on this CPU, setting it to false");
10241022
FLAG_SET_DEFAULT(UseAPX, false);
1025-
} else if (FLAG_IS_DEFAULT(UseAPX)) {
1026-
FLAG_SET_DEFAULT(UseAPX, apx_supported ? true : false);
10271023
}
10281024

10291025
if (!UseAPX) {
@@ -3151,17 +3147,11 @@ bool VM_Version::os_supports_apx_egprs() {
31513147
if (!supports_apx_f()) {
31523148
return false;
31533149
}
3154-
// Enable APX support for product builds after
3155-
// completion of planned features listed in JDK-8329030.
3156-
#if !defined(PRODUCT)
31573150
if (_cpuid_info.apx_save[0] != egpr_test_value() ||
31583151
_cpuid_info.apx_save[1] != egpr_test_value()) {
31593152
return false;
31603153
}
31613154
return true;
3162-
#else
3163-
return false;
3164-
#endif
31653155
}
31663156

31673157
uint VM_Version::cores_per_cpu() {

src/hotspot/os/windows/os_windows.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2623,15 +2623,13 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
26232623
return Handle_Exception(exceptionInfo, VM_Version::cpuinfo_cont_addr());
26242624
}
26252625

2626-
#if !defined(PRODUCT)
26272626
if ((exception_code == EXCEPTION_ACCESS_VIOLATION) &&
26282627
VM_Version::is_cpuinfo_segv_addr_apx(pc)) {
26292628
// Verify that OS save/restore APX registers.
26302629
VM_Version::clear_apx_test_state();
26312630
return Handle_Exception(exceptionInfo, VM_Version::cpuinfo_cont_addr_apx());
26322631
}
26332632
#endif
2634-
#endif
26352633

26362634
#ifdef CAN_SHOW_REGISTERS_ON_ASSERT
26372635
if (VMError::was_assert_poison_crash(exception_record)) {

src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,11 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
429429
stub = VM_Version::cpuinfo_cont_addr();
430430
}
431431

432-
#if !defined(PRODUCT) && defined(_LP64)
433432
if ((sig == SIGSEGV || sig == SIGBUS) && VM_Version::is_cpuinfo_segv_addr_apx(pc)) {
434433
// Verify that OS save/restore APX registers.
435434
stub = VM_Version::cpuinfo_cont_addr_apx();
436435
VM_Version::clear_apx_test_state();
437436
}
438-
#endif
439437

440438
// We test if stub is already set (by the stack overflow code
441439
// above) so it is not overwritten by the code that follows. This

src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,11 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
255255
stub = VM_Version::cpuinfo_cont_addr();
256256
}
257257

258-
#if !defined(PRODUCT) && defined(_LP64)
259258
if ((sig == SIGSEGV) && VM_Version::is_cpuinfo_segv_addr_apx(pc)) {
260259
// Verify that OS save/restore APX registers.
261260
stub = VM_Version::cpuinfo_cont_addr_apx();
262261
VM_Version::clear_apx_test_state();
263262
}
264-
#endif
265263

266264
if (thread->thread_state() == _thread_in_Java) {
267265
// Java thread running in Java code => find exception handler if any

src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,27 +1452,23 @@ void ShenandoahHeap::print_heap_regions_on(outputStream* st) const {
14521452
}
14531453
}
14541454

1455-
size_t ShenandoahHeap::trash_humongous_region_at(ShenandoahHeapRegion* start) {
1455+
size_t ShenandoahHeap::trash_humongous_region_at(ShenandoahHeapRegion* start) const {
14561456
assert(start->is_humongous_start(), "reclaim regions starting with the first one");
1457-
1458-
oop humongous_obj = cast_to_oop(start->bottom());
1459-
size_t size = humongous_obj->size();
1460-
size_t required_regions = ShenandoahHeapRegion::required_regions(size * HeapWordSize);
1461-
size_t index = start->index() + required_regions - 1;
1462-
14631457
assert(!start->has_live(), "liveness must be zero");
14641458

1465-
for(size_t i = 0; i < required_regions; i++) {
1466-
// Reclaim from tail. Otherwise, assertion fails when printing region to trace log,
1467-
// as it expects that every region belongs to a humongous region starting with a humongous start region.
1468-
ShenandoahHeapRegion* region = get_region(index --);
1469-
1470-
assert(region->is_humongous(), "expect correct humongous start or continuation");
1459+
// Do not try to get the size of this humongous object. STW collections will
1460+
// have already unloaded classes, so an unmarked object may have a bad klass pointer.
1461+
ShenandoahHeapRegion* region = start;
1462+
size_t index = region->index();
1463+
do {
1464+
assert(region->is_humongous(), "Expect correct humongous start or continuation");
14711465
assert(!region->is_cset(), "Humongous region should not be in collection set");
1472-
14731466
region->make_trash_immediate();
1474-
}
1475-
return required_regions;
1467+
region = get_region(++index);
1468+
} while (region != nullptr && region->is_humongous_continuation());
1469+
1470+
// Return number of regions trashed
1471+
return index - start->index();
14761472
}
14771473

14781474
class ShenandoahCheckCleanGCLABClosure : public ThreadClosure {

src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ class ShenandoahHeap : public CollectedHeap {
828828
static inline void atomic_clear_oop(narrowOop* addr, oop compare);
829829
static inline void atomic_clear_oop(narrowOop* addr, narrowOop compare);
830830

831-
size_t trash_humongous_region_at(ShenandoahHeapRegion *r);
831+
size_t trash_humongous_region_at(ShenandoahHeapRegion *r) const;
832832

833833
static inline void increase_object_age(oop obj, uint additional_age);
834834

src/hotspot/share/gc/shenandoah/shenandoahScanRemembered.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ void ShenandoahDirectCardMarkRememberedSet::swap_card_tables() {
624624

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

629629
while (start_bp <= end_bp) {
630630
assert(*start_bp == CardTable::clean_card_val(), "Should be clean: " PTR_FORMAT, p2i(start_bp));

0 commit comments

Comments
 (0)