Skip to content

Commit

Permalink
Automatic merge of jdk:master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Nov 18, 2020
2 parents 2f61353 + 50a2c22 commit 9e09cf9
Show file tree
Hide file tree
Showing 20 changed files with 155 additions and 262 deletions.
38 changes: 1 addition & 37 deletions src/hotspot/os/aix/os_aix.cpp
Expand Up @@ -1440,25 +1440,6 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
// Nothing to do beyond of what os::print_cpu_info() does.
}

void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
st->print_cr("Signal Handlers:");
PosixSignals::print_signal_handler(st, SIGSEGV, buf, buflen);
PosixSignals::print_signal_handler(st, SIGBUS , buf, buflen);
PosixSignals::print_signal_handler(st, SIGFPE , buf, buflen);
PosixSignals::print_signal_handler(st, SIGPIPE, buf, buflen);
PosixSignals::print_signal_handler(st, SIGXFSZ, buf, buflen);
PosixSignals::print_signal_handler(st, SIGILL , buf, buflen);
PosixSignals::print_signal_handler(st, SR_signum, buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN1_SIGNAL, buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN2_SIGNAL , buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN3_SIGNAL , buf, buflen);
PosixSignals::print_signal_handler(st, BREAK_SIGNAL, buf, buflen);
PosixSignals::print_signal_handler(st, SIGTRAP, buf, buflen);
// We also want to know if someone else adds a SIGDANGER handler because
// that will interfere with OOM killling.
PosixSignals::print_signal_handler(st, SIGDANGER, buf, buflen);
}

static char saved_jvm_path[MAXPATHLEN] = {0};

// Find the full path to the current module, libjvm.so.
Expand Down Expand Up @@ -2518,19 +2499,10 @@ jint os::init_2(void) {
LoadedLibraries::print(tty);
}

// initialize suspend/resume support - must do this before signal_sets_init()
if (PosixSignals::SR_initialize() != 0) {
perror("SR_initialize failed");
if (PosixSignals::init() == JNI_ERR) {
return JNI_ERR;
}

PosixSignals::signal_sets_init();
PosixSignals::install_signal_handlers();
// Initialize data for jdk.internal.misc.Signal
if (!ReduceSignalUsage) {
PosixSignals::jdk_misc_signal_init();
}

// Check and sets minimum stack sizes against command line options
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
return JNI_ERR;
Expand Down Expand Up @@ -2600,14 +2572,6 @@ bool os::bind_to_processor(uint processor_id) {
return false;
}

void os::SuspendedThreadTask::internal_do_task() {
if (PosixSignals::do_suspend(_thread->osthread())) {
SuspendedThreadTaskContext context(_thread, _thread->osthread()->ucontext());
do_task(context);
PosixSignals::do_resume(_thread->osthread());
}
}

////////////////////////////////////////////////////////////////////////////////
// debug support

Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/os/aix/os_aix.hpp
Expand Up @@ -92,11 +92,8 @@ class Aix {
return _page_size;
}

static address ucontext_get_pc(const ucontext_t* uc);
static intptr_t* ucontext_get_sp(const ucontext_t* uc);
static intptr_t* ucontext_get_fp(const ucontext_t* uc);
// Set PC into context. Needed for continuation after signal.
static void ucontext_set_pc(ucontext_t* uc, address pc);

static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr);

Expand Down
34 changes: 1 addition & 33 deletions src/hotspot/os/bsd/os_bsd.cpp
Expand Up @@ -1540,21 +1540,6 @@ void os::print_memory_info(outputStream* st) {
st->cr();
}

void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
st->print_cr("Signal Handlers:");
PosixSignals::print_signal_handler(st, SIGSEGV, buf, buflen);
PosixSignals::print_signal_handler(st, SIGBUS , buf, buflen);
PosixSignals::print_signal_handler(st, SIGFPE , buf, buflen);
PosixSignals::print_signal_handler(st, SIGPIPE, buf, buflen);
PosixSignals::print_signal_handler(st, SIGXFSZ, buf, buflen);
PosixSignals::print_signal_handler(st, SIGILL , buf, buflen);
PosixSignals::print_signal_handler(st, SR_signum, buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN1_SIGNAL, buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN2_SIGNAL , buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN3_SIGNAL , buf, buflen);
PosixSignals::print_signal_handler(st, BREAK_SIGNAL, buf, buflen);
}

static char saved_jvm_path[MAXPATHLEN] = {0};

// Find the full path to the current module, libjvm
Expand Down Expand Up @@ -2139,19 +2124,10 @@ jint os::init_2(void) {

os::Posix::init_2();

// initialize suspend/resume support - must do this before signal_sets_init()
if (PosixSignals::SR_initialize() != 0) {
perror("SR_initialize failed");
if (PosixSignals::init() == JNI_ERR) {
return JNI_ERR;
}

PosixSignals::signal_sets_init();
PosixSignals::install_signal_handlers();
// Initialize data for jdk.internal.misc.Signal
if (!ReduceSignalUsage) {
PosixSignals::jdk_misc_signal_init();
}

// Check and sets minimum stack sizes against command line options
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
return JNI_ERR;
Expand Down Expand Up @@ -2282,14 +2258,6 @@ bool os::bind_to_processor(uint processor_id) {
return false;
}

void os::SuspendedThreadTask::internal_do_task() {
if (PosixSignals::do_suspend(_thread->osthread())) {
SuspendedThreadTaskContext context(_thread, _thread->osthread()->ucontext());
do_task(context);
PosixSignals::do_resume(_thread->osthread());
}
}

////////////////////////////////////////////////////////////////////////////////
// debug support

Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/os/bsd/os_bsd.hpp
Expand Up @@ -68,8 +68,6 @@ class Bsd {
static int page_size(void) { return _page_size; }
static void set_page_size(int val) { _page_size = val; }

static address ucontext_get_pc(const ucontext_t* uc);
static void ucontext_set_pc(ucontext_t* uc, address pc);
static intptr_t* ucontext_get_sp(const ucontext_t* uc);
static intptr_t* ucontext_get_fp(const ucontext_t* uc);

Expand Down
41 changes: 2 additions & 39 deletions src/hotspot/os/linux/os_linux.cpp
Expand Up @@ -994,7 +994,7 @@ void os::free_thread(OSThread* osthread) {
sigset_t current;
sigemptyset(&current);
pthread_sigmask(SIG_SETMASK, NULL, &current);
assert(!sigismember(&current, SR_signum), "SR signal should not be blocked!");
assert(!sigismember(&current, PosixSignals::SR_signum), "SR signal should not be blocked!");
#endif

// Restore caller's signal mask
Expand Down Expand Up @@ -2620,24 +2620,6 @@ void os::get_summary_cpu_info(char* cpuinfo, size_t length) {
#endif
}

void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
st->print_cr("Signal Handlers:");
PosixSignals::print_signal_handler(st, SIGSEGV, buf, buflen);
PosixSignals::print_signal_handler(st, SIGBUS , buf, buflen);
PosixSignals::print_signal_handler(st, SIGFPE , buf, buflen);
PosixSignals::print_signal_handler(st, SIGPIPE, buf, buflen);
PosixSignals::print_signal_handler(st, SIGXFSZ, buf, buflen);
PosixSignals::print_signal_handler(st, SIGILL , buf, buflen);
PosixSignals::print_signal_handler(st, SR_signum, buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN1_SIGNAL, buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN2_SIGNAL , buf, buflen);
PosixSignals::print_signal_handler(st, SHUTDOWN3_SIGNAL , buf, buflen);
PosixSignals::print_signal_handler(st, BREAK_SIGNAL, buf, buflen);
#if defined(PPC64)
PosixSignals::print_signal_handler(st, SIGTRAP, buf, buflen);
#endif
}

static char saved_jvm_path[MAXPATHLEN] = {0};

// Find the full path to the current module, libjvm.so
Expand Down Expand Up @@ -4543,19 +4525,10 @@ jint os::init_2(void) {

Linux::fast_thread_clock_init();

// initialize suspend/resume support - must do this before signal_sets_init()
if (PosixSignals::SR_initialize() != 0) {
perror("SR_initialize failed");
if (PosixSignals::init() == JNI_ERR) {
return JNI_ERR;
}

PosixSignals::signal_sets_init();
PosixSignals::install_signal_handlers();
// Initialize data for jdk.internal.misc.Signal
if (!ReduceSignalUsage) {
PosixSignals::jdk_misc_signal_init();
}

if (AdjustStackSizeForTLS) {
get_minstack_init();
}
Expand Down Expand Up @@ -4808,16 +4781,6 @@ bool os::bind_to_processor(uint processor_id) {
return false;
}

///

void os::SuspendedThreadTask::internal_do_task() {
if (PosixSignals::do_suspend(_thread->osthread())) {
SuspendedThreadTaskContext context(_thread, _thread->osthread()->ucontext());
do_task(context);
PosixSignals::do_resume(_thread->osthread());
}
}

////////////////////////////////////////////////////////////////////////////////
// debug support

Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/os/linux/os_linux.hpp
Expand Up @@ -134,8 +134,6 @@ class Linux {
static int page_size(void) { return _page_size; }
static void set_page_size(int val) { _page_size = val; }

static address ucontext_get_pc(const ucontext_t* uc);
static void ucontext_set_pc(ucontext_t* uc, address pc);
static intptr_t* ucontext_get_sp(const ucontext_t* uc);
static intptr_t* ucontext_get_fp(const ucontext_t* uc);

Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/os/posix/os_posix.hpp
Expand Up @@ -88,6 +88,10 @@ class Posix {

static void print_user_info(outputStream* st);

// Set PC into context. Needed for continuation after signal.
static address ucontext_get_pc(const ucontext_t* ctx);
static void ucontext_set_pc(ucontext_t* ctx, address pc);

#ifdef SUPPORTS_CLOCK_MONOTONIC

private:
Expand Down

0 comments on commit 9e09cf9

Please sign in to comment.