diff options
Diffstat (limited to 'java/openjdk6/files/patch-set')
-rw-r--r-- | java/openjdk6/files/patch-set | 300 |
1 files changed, 263 insertions, 37 deletions
diff --git a/java/openjdk6/files/patch-set b/java/openjdk6/files/patch-set index 405fc9df13aa..8d3cc7509709 100644 --- a/java/openjdk6/files/patch-set +++ b/java/openjdk6/files/patch-set @@ -579,23 +579,34 @@ HOSTCXX = $(CXX) HOSTCC = $(CC) endif ---- hotspot/src/cpu/x86/vm/globals_x86.hpp -+++ hotspot/src/cpu/x86/vm/globals_x86.hpp -@@ -70,11 +70,7 @@ - define_pd_global(bool, RewriteBytecodes, true); - define_pd_global(bool, RewriteFrequentPairs, true); +--- hotspot/src/os/bsd/vm/jsig.c ++++ hotspot/src/os/bsd/vm/jsig.c +@@ -140,9 +140,13 @@ + } --#ifdef _ALLBSD_SOURCE --define_pd_global(bool, UseMembar, true); --#else - define_pd_global(bool, UseMembar, false); --#endif + sa_handler_t sigset(int sig, sa_handler_t disp) { ++#ifdef __FreeBSD__ ++ return set_signal(sig, disp, true); ++#else + printf("sigset() is not supported by BSD"); + exit(0); +- } ++#endif ++} - // GC Ergo Flags - define_pd_global(intx, CMSYoungGenPerWorker, 64*M); // default max size of CMS young gen, per GC worker thread + static int call_os_sigaction(int sig, const struct sigaction *act, + struct sigaction *oact) { --- hotspot/src/os/bsd/vm/jvm_bsd.cpp +++ hotspot/src/os/bsd/vm/jvm_bsd.cpp -@@ -110,71 +110,30 @@ +@@ -50,6 +50,7 @@ + case INTERRUPT_SIGNAL: + case SIGFPE: + case SIGILL: ++ case SIGBUS: + case SIGSEGV: + + /* The following signal is used by the VM to dump thread stacks unless +@@ -110,71 +111,29 @@ JVM_END /* @@ -617,9 +628,8 @@ - CLD, CHLD, CONT, TSTP, TTIN, TTOU, URG, XCPU, XFSZ, VTALRM, PROF, - WINCH, POLL, IO, PWR, SYS - -+ HUP, INT, TRAP, ABRT, EMT, BUS, SYS, PIPE, ALRM, TERM, URG, TSTP, -+ CONT, CHLD, TTIN, TTOU, IO, XCPU, XFSZ, VTALRM, PROF, WINCH, INFO, -+ USR2 ++ HUP, INT, TRAP, ABRT, EMT, SYS, PIPE, ALRM, TERM, URG, TSTP, CONT, ++ CHLD, TTIN, TTOU, IO, XCPU, XFSZ, VTALRM, PROF, WINCH, INFO, USR2 */ -struct siglabel { @@ -780,7 +790,31 @@ #if defined(__FreeBSD__) || defined(__NetBSD__) # include <elf.h> #endif -@@ -205,6 +217,28 @@ +@@ -162,8 +174,10 @@ + #endif + + int (*os::Bsd::_clock_gettime)(clockid_t, struct timespec *) = NULL; +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + int (*os::Bsd::_pthread_getcpuclockid)(pthread_t, clockid_t *) = NULL; ++#endif ++#ifndef _ALLBSD_SOURCE + Mutex* os::Bsd::_createThread_lock = NULL; + #endif + pthread_t os::Bsd::_main_thread; +@@ -171,7 +185,11 @@ + #ifndef _ALLBSD_SOURCE + bool os::Bsd::_is_floating_stack = false; + bool os::Bsd::_is_NPTL = false; ++#endif ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + bool os::Bsd::_supports_fast_thread_cpu_time = false; ++#endif ++#ifndef _ALLBSD_SOURCE + const char * os::Bsd::_glibc_version = NULL; + const char * os::Bsd::_libpthread_version = NULL; + #endif +@@ -205,6 +223,28 @@ julong os::Bsd::available_memory() { #ifdef _ALLBSD_SOURCE @@ -809,7 +843,7 @@ // XXXBSD: this is just a stopgap implementation return physical_memory() >> 2; #else -@@ -221,6 +255,17 @@ +@@ -221,6 +261,17 @@ } julong os::allocatable_physical_memory(julong size) { @@ -827,7 +861,7 @@ #ifdef _LP64 return size; #else -@@ -308,16 +353,22 @@ +@@ -308,16 +359,22 @@ #define COMPILER_VARIANT "client" #endif @@ -854,7 +888,7 @@ int rslt = syscall(SYS_gettid); if (rslt == -1) { // old kernel, no NPTL support -@@ -325,6 +376,7 @@ +@@ -325,6 +382,7 @@ } else { return (pid_t)rslt; } @@ -862,7 +896,7 @@ } // Most versions of bsd have a bug where the number of processors are -@@ -337,7 +389,35 @@ +@@ -337,7 +395,35 @@ "environment on Bsd when /proc filesystem is not mounted."; #endif @@ -899,7 +933,7 @@ void os::Bsd::initialize_system_info() { int mib[2]; size_t len; -@@ -452,7 +532,7 @@ +@@ -452,7 +538,7 @@ * 7: The default directories, normally /lib and /usr/lib. */ #ifndef DEFAULT_LIBPATH @@ -908,7 +942,7 @@ #endif #define EXTENSIONS_DIR "/lib/ext" -@@ -997,7 +1077,7 @@ +@@ -997,7 +1083,7 @@ return NULL; } @@ -917,7 +951,7 @@ #ifdef __APPLE__ // thread_id is mach thread on macos osthread->set_thread_id(::mach_thread_self()); -@@ -1009,6 +1089,7 @@ +@@ -1009,6 +1095,7 @@ // thread_id is kernel thread id (similar to Solaris LWP id) osthread->set_thread_id(os::Bsd::gettid()); @@ -925,7 +959,7 @@ if (UseNUMA) { int lgrp_id = os::numa_get_group_id(); if (lgrp_id != -1) { -@@ -1016,6 +1097,7 @@ +@@ -1016,6 +1103,7 @@ } } #endif @@ -933,7 +967,16 @@ // initialize signal mask for this thread os::Bsd::hotspot_sigmask(thread); -@@ -1194,7 +1276,7 @@ +@@ -1105,7 +1193,7 @@ + // let pthread_create() pick the default value. + } + +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + // glibc guard page + pthread_attr_setguardsize(&attr, os::Bsd::default_guard_size(thr_type)); + #endif +@@ -1194,7 +1282,7 @@ } // Store pthread info into the OSThread @@ -942,7 +985,27 @@ #ifdef __APPLE__ osthread->set_thread_id(::mach_thread_self()); #else -@@ -1817,8 +1899,10 @@ +@@ -1630,7 +1718,10 @@ + } + #endif + +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) ++#ifdef __FreeBSD__ ++#define sys_clock_getres clock_getres ++#else + #ifndef SYS_clock_getres + + #if defined(IA32) || defined(AMD64) +@@ -1644,6 +1735,7 @@ + #else + #define sys_clock_getres(x,y) ::syscall(SYS_clock_getres, x, y) + #endif ++#endif + + void os::Bsd::fast_thread_clock_init() { + if (!UseBsdPosixThreadCPUClocks) { +@@ -1817,8 +1909,10 @@ } intx os::current_thread_id() { @@ -954,7 +1017,7 @@ #else return (intx)::pthread_self(); #endif -@@ -2341,14 +2425,16 @@ +@@ -2341,14 +2435,16 @@ } void os::print_os_info_brief(outputStream* st) { @@ -973,7 +1036,7 @@ os::Posix::print_uname_info(st); -@@ -2366,7 +2452,23 @@ +@@ -2366,7 +2462,23 @@ st->print("Memory:"); st->print(" %dk page", os::vm_page_size()>>10); @@ -998,7 +1061,7 @@ // values in struct sysinfo are "unsigned long" struct sysinfo si; sysinfo(&si); -@@ -2376,17 +2478,22 @@ +@@ -2376,17 +2488,22 @@ os::physical_memory() >> 10); st->print("(" UINT64_FORMAT "k free)", os::available_memory() >> 10); @@ -1023,7 +1086,25 @@ st->cr(); } -@@ -2533,10 +2640,17 @@ +@@ -2399,7 +2516,7 @@ + + const char *fpe_names[] = { "FPE0", "FPE_INTDIV", "FPE_INTOVF", "FPE_FLTDIV", + "FPE_FLTOVF", "FPE_FLTUND", "FPE_FLTRES", +- "FPE_FLTINV", "FPE_FLTSUB", "FPE_FLTDEN" }; ++ "FPE_FLTINV", "FPE_FLTSUB" }; + + const char *segv_names[] = { "SEGV0", "SEGV_MAPERR", "SEGV_ACCERR" }; + +@@ -2425,7 +2542,7 @@ + st->print(", si_addr=" PTR_FORMAT, si->si_addr); + break; + case SIGFPE: +- st->print(", si_code=%d (%s)", c, c > 9 ? "" : fpe_names[c]); ++ st->print(", si_code=%d (%s)", c, c > 8 ? "" : fpe_names[c]); + st->print(", si_addr=" PTR_FORMAT, si->si_addr); + break; + case SIGSEGV: +@@ -2533,10 +2650,17 @@ jrelib_p = buf + len; // Add the appropriate library subdir @@ -1041,7 +1122,7 @@ // Add the appropriate client or server subdir len = strlen(buf); -@@ -2997,9 +3111,10 @@ +@@ -2997,9 +3121,10 @@ flags |= MAP_FIXED; } @@ -1055,7 +1136,7 @@ flags, -1, 0); if (addr != MAP_FAILED) { -@@ -3156,7 +3271,9 @@ +@@ -3156,7 +3281,9 @@ static size_t _large_page_size = 0; void os::large_page_init() { @@ -1066,7 +1147,7 @@ if (!UseLargePages) { UseHugeTLBFS = false; UseSHM = false; -@@ -3654,8 +3771,8 @@ +@@ -3654,8 +3781,8 @@ return OS_OK; #else int ret = setpriority(PRIO_PROCESS, thread->osthread()->thread_id(), newpri); @@ -1076,7 +1157,25 @@ } OSReturn os::get_native_priority(const Thread* const thread, int *priority_ptr) { -@@ -4634,6 +4751,20 @@ +@@ -4171,7 +4298,7 @@ + } + } + +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + // This is the fastest way to get thread cpu time on Bsd. + // Returns cpu time (user+sys) for any thread, not only for current. + // POSIX compliant clocks are implemented in the kernels 2.6.16+. +@@ -4450,7 +4577,7 @@ + // this is called _after_ the global arguments have been parsed + jint os::init_2(void) + { +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + Bsd::fast_thread_clock_init(); + #endif + +@@ -4634,6 +4761,20 @@ int os::active_processor_count() { #ifdef _ALLBSD_SOURCE @@ -1097,9 +1196,110 @@ return _processor_count; #else // Bsd doesn't yet have a (official) notion of processor sets, +@@ -5033,7 +5174,7 @@ + return munmap(addr, bytes) == 0; + } + +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time); + + static clockid_t thread_cpu_clockid(Thread* thread) { +@@ -5057,7 +5198,7 @@ + jlong os::current_thread_cpu_time() { + #ifdef __APPLE__ + return os::thread_cpu_time(Thread::current(), true /* user + sys */); +-#elif !defined(_ALLBSD_SOURCE) ++#elif !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + if (os::Bsd::supports_fast_thread_cpu_time()) { + return os::Bsd::fast_thread_cpu_time(CLOCK_THREAD_CPUTIME_ID); + } else { +@@ -5068,7 +5209,7 @@ + } + + jlong os::thread_cpu_time(Thread* thread) { +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + // consistent with what current_thread_cpu_time() returns + if (os::Bsd::supports_fast_thread_cpu_time()) { + return os::Bsd::fast_thread_cpu_time(thread_cpu_clockid(thread)); +@@ -5081,7 +5222,7 @@ + jlong os::current_thread_cpu_time(bool user_sys_cpu_time) { + #ifdef __APPLE__ + return os::thread_cpu_time(Thread::current(), user_sys_cpu_time); +-#elif !defined(_ALLBSD_SOURCE) ++#elif !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + if (user_sys_cpu_time && os::Bsd::supports_fast_thread_cpu_time()) { + return os::Bsd::fast_thread_cpu_time(CLOCK_THREAD_CPUTIME_ID); + } else { +@@ -5110,7 +5251,7 @@ + } else { + return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000); + } +-#elif !defined(_ALLBSD_SOURCE) ++#elif !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + if (user_sys_cpu_time && os::Bsd::supports_fast_thread_cpu_time()) { + return os::Bsd::fast_thread_cpu_time(thread_cpu_clockid(thread)); + } else { +@@ -5119,12 +5260,15 @@ + #endif + } + +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + // + // -1 on error. + // + + static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { ++#ifdef __FreeBSD__ ++ return -1; ++#else + static bool proc_pid_cpu_avail = true; + static bool proc_task_unchecked = true; + static const char *proc_stat_path = "/proc/%d/stat"; +@@ -5208,6 +5352,7 @@ + } else { + return (jlong)user_time * (1000000000 / clock_tics_per_sec); + } ++#endif + } + #endif + +@@ -5226,7 +5371,7 @@ + } + + bool os::is_thread_cpu_time_supported() { +-#ifdef __APPLE__ ++#if defined(__APPLE__) || defined(__FreeBSD__) + return true; + #elif defined(_ALLBSD_SOURCE) + return false; --- hotspot/src/os/bsd/vm/os_bsd.hpp +++ hotspot/src/os/bsd/vm/os_bsd.hpp -@@ -112,13 +112,15 @@ +@@ -56,9 +56,11 @@ + static int sigflags[MAXSIGNUM]; + + static int (*_clock_gettime)(clockid_t, struct timespec *); +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *); ++#endif + ++#ifndef _ALLBSD_SOURCE + static address _initial_thread_stack_bottom; + static uintptr_t _initial_thread_stack_size; + +@@ -67,6 +69,8 @@ + + static bool _is_floating_stack; + static bool _is_NPTL; ++#endif ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + static bool _supports_fast_thread_cpu_time; + #endif + +@@ -112,13 +116,15 @@ #endif static pthread_t main_thread(void) { return _main_thread; } @@ -1116,7 +1316,13 @@ static void hotspot_sigmask(Thread* thread); #ifndef _ALLBSD_SOURCE -@@ -202,7 +204,7 @@ +@@ -197,12 +203,12 @@ + // Real-time clock functions + static void clock_init(void); + +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + // fast POSIX clocks support static void fast_thread_clock_init(void); #endif @@ -1125,6 +1331,15 @@ return _clock_gettime != NULL; } +@@ -210,7 +216,7 @@ + return _clock_gettime ? _clock_gettime(clock_id, tp) : -1; + } + +-#ifndef _ALLBSD_SOURCE ++#if !defined(_ALLBSD_SOURCE) || defined(__FreeBSD__) + static int pthread_getcpuclockid(pthread_t tid, clockid_t *clock_id) { + return _pthread_getcpuclockid ? _pthread_getcpuclockid(tid, clock_id) : -1; + } --- hotspot/src/os/bsd/vm/threadCritical_bsd.cpp +++ hotspot/src/os/bsd/vm/threadCritical_bsd.cpp @@ -33,35 +33,36 @@ @@ -1945,6 +2160,17 @@ void* result = (void*) tp->area_top; tp->area_top += size; +--- hotspot/src/share/vm/runtime/globals.hpp ++++ hotspot/src/share/vm/runtime/globals.hpp +@@ -1125,7 +1125,7 @@ + product(intx, hashCode, 0, \ + "(Unstable) select hashCode generation algorithm" ) \ + \ +- product(intx, WorkAroundNPTLTimedWaitHang, 1, \ ++ product(intx, WorkAroundNPTLTimedWaitHang, 0, \ + "(Unstable, Linux-specific)" \ + " avoid NPTL-FUTEX hang pthread_cond_timedwait" ) \ + \ --- hotspot/src/share/vm/runtime/interfaceSupport.hpp +++ hotspot/src/share/vm/runtime/interfaceSupport.hpp @@ -67,7 +67,7 @@ |