Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Nov 7, 2024
2 parents 580a95d + d2b681d commit ea285c9
Show file tree
Hide file tree
Showing 83 changed files with 1,138 additions and 518 deletions.
4 changes: 4 additions & 0 deletions make/RunTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,10 @@ define SetupRunJtregTestBody
JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt
endif

ifneq ($$(findstring -XX:+UseShenandoahGC, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-shenandoah.txt
endif

ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
Expand Down
115 changes: 71 additions & 44 deletions src/hotspot/cpu/x86/assembler_x86.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/hotspot/cpu/x86/macroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4092,7 +4092,7 @@ RegSet MacroAssembler::call_clobbered_gp_registers() {
RegSet regs;
#ifdef _LP64
regs += RegSet::of(rax, rcx, rdx);
#ifndef WINDOWS
#ifndef _WINDOWS
regs += RegSet::of(rsi, rdi);
#endif
regs += RegSet::range(r8, r11);
Expand All @@ -4109,7 +4109,7 @@ RegSet MacroAssembler::call_clobbered_gp_registers() {

XMMRegSet MacroAssembler::call_clobbered_xmm_registers() {
int num_xmm_registers = XMMRegister::available_xmm_registers();
#if defined(WINDOWS) && defined(_LP64)
#if defined(_WINDOWS) && defined(_LP64)
XMMRegSet result = XMMRegSet::range(xmm0, xmm5);
if (num_xmm_registers > 16) {
result += XMMRegSet::range(xmm16, as_XMMRegister(num_xmm_registers - 1));
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os/posix/perfMemory_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ static char* mmap_create_shared(size_t size) {
static void unmap_shared(char* addr, size_t bytes) {
int res;
if (MemTracker::enabled()) {
NmtVirtualMemoryLocker ml;
ThreadCritical tc;
res = ::munmap(addr, bytes);
if (res == 0) {
MemTracker::record_virtual_memory_release((address)addr, bytes);
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3825,8 +3825,7 @@ bool os::pd_release_memory(char* addr, size_t bytes) {
if (err != nullptr) {
log_warning(os)("bad release: [" PTR_FORMAT "-" PTR_FORMAT "): %s", p2i(start), p2i(end), err);
#ifdef ASSERT
fileStream fs(stdout);
os::print_memory_mappings((char*)start, bytes, &fs);
os::print_memory_mappings((char*)start, bytes, tty);
assert(false, "bad release: [" PTR_FORMAT "-" PTR_FORMAT "): %s", p2i(start), p2i(end), err);
#endif
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/os/windows/perfMemory_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,7 @@ void PerfMemory::detach(char* addr, size_t bytes) {

if (MemTracker::enabled()) {
// it does not go through os api, the operation has to record from here
NmtVirtualMemoryLocker ml;
ThreadCritical tc;
remove_file_mapping(addr);
MemTracker::record_virtual_memory_release((address)addr, bytes);
} else {
Expand Down
29 changes: 6 additions & 23 deletions src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
intptr_t* sp;
intptr_t* fp;
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
// Avoid crash during crash if pc broken.
if (epc) {
frame fr(sp, epc, frame::kind::unknown);
return fr;
if (epc == nullptr || !is_readable_pointer(epc)) {
// Try to recover from calling into bad memory
// Assume new frame has not been set up, the same as
// compiled frame stack bang
return fetch_compiled_frame_from_context(ucVoid);
}
frame fr(sp);
return fr;
return frame(sp, epc, frame::kind::unknown);
}

frame os::fetch_compiled_frame_from_context(const void* ucVoid) {
Expand Down Expand Up @@ -447,23 +447,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Aix::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Posix::ucontext_get_pc(uc);
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = 32 /* r0-r32 */ + 3 /* pc, lr, sp */;
int n = continuation;
Expand Down
23 changes: 6 additions & 17 deletions src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
intptr_t* sp;
intptr_t* fp;
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
if (!is_readable_pointer(epc)) {
// Try to recover from calling into bad memory
// Assume new frame has not been set up, the same as
// compiled frame stack bang
return fetch_compiled_frame_from_context(ucVoid);
}
return frame(sp, fp, epc);
}

Expand Down Expand Up @@ -442,23 +448,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Bsd::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Posix::ucontext_get_pc(uc);
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = 29 /* x0-x28 */ + 3 /* fp, lr, sp */;
int n = continuation;
Expand Down
23 changes: 6 additions & 17 deletions src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
intptr_t* sp;
intptr_t* fp;
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
if (!is_readable_pointer(epc)) {
// Try to recover from calling into bad memory
// Assume new frame has not been set up, the same as
// compiled frame stack bang
return fetch_compiled_frame_from_context(ucVoid);
}
return frame(sp, fp, epc);
}

Expand Down Expand Up @@ -836,23 +842,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Bsd::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Posix::ucontext_get_pc(uc);
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = AMD64_ONLY(16) NOT_AMD64(8);
int n = continuation;
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,6 @@ void os::print_context(outputStream* st, const void* context) {
ShouldNotCallThis();
}

void os::print_tos_pc(outputStream *st, const void *context) {
ShouldNotCallThis();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
ShouldNotCallThis();
}
Expand Down
17 changes: 0 additions & 17 deletions src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,23 +354,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Linux::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::fetch_frame_from_context(uc).pc();
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = 32 /* r0-r31 */;
int n = continuation;
Expand Down
35 changes: 18 additions & 17 deletions src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,27 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
intptr_t* sp;
intptr_t* fp;
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
if (!is_readable_pointer(epc)) {
// Try to recover from calling into bad memory
// Assume new frame has not been set up, the same as
// compiled frame stack bang
return fetch_compiled_frame_from_context(ucVoid);
}
return frame(sp, fp, epc);
}

frame os::fetch_compiled_frame_from_context(const void* ucVoid) {
const ucontext_t* uc = (const ucontext_t*)ucVoid;
// In compiled code, the stack banging is performed before LR
// has been saved in the frame. LR is live, and SP and FP
// belong to the caller.
intptr_t* fp = os::Linux::ucontext_get_fp(uc);
intptr_t* sp = os::Linux::ucontext_get_sp(uc);
address pc = (address)(uc->uc_mcontext.arm_lr
- NativeInstruction::instruction_size);
return frame(sp, fp, pc);
}

frame os::get_sender_for_C_frame(frame* fr) {
#ifdef __thumb__
// We can't reliably get anything from a thumb C frame.
Expand Down Expand Up @@ -474,23 +492,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Linux::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Posix::ucontext_get_pc(uc);
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = ARM_REGS_IN_CONTEXT;
int n = continuation;
Expand Down
23 changes: 6 additions & 17 deletions src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
intptr_t* sp;
intptr_t* fp;
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
if (!is_readable_pointer(epc)) {
// Try to recover from calling into bad memory
// Assume new frame has not been set up, the same as
// compiled frame stack bang
return fetch_compiled_frame_from_context(ucVoid);
}
return frame(sp, epc, frame::kind::unknown);
}

Expand Down Expand Up @@ -461,23 +467,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Linux::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Posix::ucontext_get_pc(uc);
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = 32 /* r0-r32 */ + 3 /* pc, lr, ctr */;
int n = continuation;
Expand Down
17 changes: 0 additions & 17 deletions src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,23 +352,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Linux::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::fetch_frame_from_context(uc).pc();
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = 32;
int n = continuation;
Expand Down
23 changes: 6 additions & 17 deletions src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ frame os::fetch_frame_from_context(const void* ucVoid) {
intptr_t* sp;
intptr_t* fp;
address epc = fetch_frame_from_context(ucVoid, &sp, &fp);
if (!is_readable_pointer(epc)) {
// Try to recover from calling into bad memory
// Assume new frame has not been set up, the same as
// compiled frame stack bang
return fetch_compiled_frame_from_context(ucVoid);
}
return frame(sp, epc);
}

Expand Down Expand Up @@ -442,23 +448,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Linux::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::Posix::ucontext_get_pc(uc);
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = 16 /* r0-r15 */ + 1 /* pc */;
int n = continuation;
Expand Down
17 changes: 0 additions & 17 deletions src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,23 +578,6 @@ void os::print_context(outputStream *st, const void *context) {
st->cr();
}

void os::print_tos_pc(outputStream *st, const void *context) {
if (context == nullptr) return;

const ucontext_t* uc = (const ucontext_t*)context;

address sp = (address)os::Linux::ucontext_get_sp(uc);
print_tos(st, sp);
st->cr();

// Note: it may be unsafe to inspect memory near pc. For example, pc may
// point to garbage if entry point in an nmethod is corrupted. Leave
// this at the end, and hope for the best.
address pc = os::fetch_frame_from_context(uc).pc();
print_instructions(st, pc);
st->cr();
}

void os::print_register_info(outputStream *st, const void *context, int& continuation) {
const int register_count = AMD64_ONLY(16) NOT_AMD64(8);
int n = continuation;
Expand Down
Loading

0 comments on commit ea285c9

Please sign in to comment.