8136978: Much nearly duplicated code for vmError support

Moved all non os specific code in vmError_[os].cpp to vmError_posix.cpp, moved os specific code to os_[os].cpp and refactored all other references accordingly

Reviewed-by: stuefe, coleenp, dholmes
This commit is contained in:
Sebastian Sickelmann 2015-11-25 16:33:28 +01:00
parent dcd4a03963
commit 4699c70e25
14 changed files with 202 additions and 480 deletions

View file

@ -988,6 +988,39 @@ void os::Posix::print_siginfo_brief(outputStream* os, const siginfo_t* si) {
}
}
int os::Posix::unblock_thread_signal_mask(const sigset_t *set) {
return pthread_sigmask(SIG_UNBLOCK, set, NULL);
}
address os::Posix::ucontext_get_pc(ucontext_t* ctx) {
#ifdef TARGET_OS_FAMILY_linux
return Linux::ucontext_get_pc(ctx);
#elif defined(TARGET_OS_FAMILY_solaris)
return Solaris::ucontext_get_pc(ctx);
#elif defined(TARGET_OS_FAMILY_aix)
return Aix::ucontext_get_pc(ctx);
#elif defined(TARGET_OS_FAMILY_bsd)
return Bsd::ucontext_get_pc(ctx);
#else
VMError::report_and_die("unimplemented ucontext_get_pc");
#endif
}
void os::Posix::ucontext_set_pc(ucontext_t* ctx, address pc) {
#ifdef TARGET_OS_FAMILY_linux
Linux::ucontext_set_pc(ctx, pc);
#elif defined(TARGET_OS_FAMILY_solaris)
Solaris::ucontext_set_pc(ctx, pc);
#elif defined(TARGET_OS_FAMILY_aix)
Aix::ucontext_set_pc(ctx, pc);
#elif defined(TARGET_OS_FAMILY_bsd)
Bsd::ucontext_set_pc(ctx, pc);
#else
VMError::report_and_die("unimplemented ucontext_get_pc");
#endif
}
os::WatcherThreadCrashProtection::WatcherThreadCrashProtection() {
assert(Thread::current()->is_Watcher_thread(), "Must be WatcherThread");
}