< prev index next >

src/os/solaris/vm/os_solaris.cpp

Print this page

        

*** 1116,1127 **** return &allowdebug_blocked_sigs; } void _handle_uncaught_cxx_exception() { ! VMError err("An uncaught C++ exception"); ! err.report_and_die(); } // First crack at OS-specific initialization, from inside the new thread. void os::initialize_thread(Thread* thr) { --- 1116,1126 ---- return &allowdebug_blocked_sigs; } void _handle_uncaught_cxx_exception() { ! VMError::report_and_die("An uncaught C++ exception"); } // First crack at OS-specific initialization, from inside the new thread. void os::initialize_thread(Thread* thr) {
*** 1328,1346 **** // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis jlong os::javaTimeMillis() { timeval t; if (gettimeofday(&t, NULL) == -1) { ! fatal(err_msg("os::javaTimeMillis: gettimeofday (%s)", strerror(errno))); } return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000; } void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { timeval t; if (gettimeofday(&t, NULL) == -1) { ! fatal(err_msg("os::javaTimeSystemUTC: gettimeofday (%s)", strerror(errno))); } seconds = jlong(t.tv_sec); nanos = jlong(t.tv_usec) * 1000; } --- 1327,1345 ---- // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis jlong os::javaTimeMillis() { timeval t; if (gettimeofday(&t, NULL) == -1) { ! fatal("os::javaTimeMillis: gettimeofday (%s)", strerror(errno)); } return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000; } void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { timeval t; if (gettimeofday(&t, NULL) == -1) { ! fatal("os::javaTimeSystemUTC: gettimeofday (%s)", strerror(errno)); } seconds = jlong(t.tv_sec); nanos = jlong(t.tv_usec) * 1000; }
*** 2390,2407 **** assert(mesg != NULL, "mesg must be specified"); int err = os::Solaris::commit_memory_impl(addr, bytes, exec); if (err != 0) { // the caller wants all commit errors to exit with the specified mesg: warn_fail_commit_memory(addr, bytes, exec, err); ! vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, mesg); } } size_t os::Solaris::page_size_for_alignment(size_t alignment) { assert(is_size_aligned(alignment, (size_t) vm_page_size()), ! err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, ! alignment, (size_t) vm_page_size())); for (int i = 0; _page_sizes[i] != 0; i++) { if (is_size_aligned(alignment, _page_sizes[i])) { return _page_sizes[i]; } --- 2389,2406 ---- assert(mesg != NULL, "mesg must be specified"); int err = os::Solaris::commit_memory_impl(addr, bytes, exec); if (err != 0) { // the caller wants all commit errors to exit with the specified mesg: warn_fail_commit_memory(addr, bytes, exec, err); ! vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, "%s", mesg); } } size_t os::Solaris::page_size_for_alignment(size_t alignment) { assert(is_size_aligned(alignment, (size_t) vm_page_size()), ! SIZE_FORMAT " is not aligned to " SIZE_FORMAT, ! alignment, (size_t) vm_page_size()); for (int i = 0; _page_sizes[i] != 0; i++) { if (is_size_aligned(alignment, _page_sizes[i])) { return _page_sizes[i]; }
*** 2413,2423 **** int os::Solaris::commit_memory_impl(char* addr, size_t bytes, size_t alignment_hint, bool exec) { int err = Solaris::commit_memory_impl(addr, bytes, exec); if (err == 0 && UseLargePages && alignment_hint > 0) { assert(is_size_aligned(bytes, alignment_hint), ! err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, alignment_hint)); // The syscall memcntl requires an exact page size (see man memcntl for details). size_t page_size = page_size_for_alignment(alignment_hint); if (page_size > (size_t) vm_page_size()) { (void)Solaris::setup_large_pages(addr, bytes, page_size); --- 2412,2422 ---- int os::Solaris::commit_memory_impl(char* addr, size_t bytes, size_t alignment_hint, bool exec) { int err = Solaris::commit_memory_impl(addr, bytes, exec); if (err == 0 && UseLargePages && alignment_hint > 0) { assert(is_size_aligned(bytes, alignment_hint), ! SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, alignment_hint); // The syscall memcntl requires an exact page size (see man memcntl for details). size_t page_size = page_size_for_alignment(alignment_hint); if (page_size > (size_t) vm_page_size()) { (void)Solaris::setup_large_pages(addr, bytes, page_size);
*** 2437,2447 **** assert(mesg != NULL, "mesg must be specified"); int err = os::Solaris::commit_memory_impl(addr, bytes, alignment_hint, exec); if (err != 0) { // the caller wants all commit errors to exit with the specified mesg: warn_fail_commit_memory(addr, bytes, alignment_hint, exec, err); ! vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, mesg); } } // Uncommit the pages in a specified region. void os::pd_free_memory(char* addr, size_t bytes, size_t alignment_hint) { --- 2436,2446 ---- assert(mesg != NULL, "mesg must be specified"); int err = os::Solaris::commit_memory_impl(addr, bytes, alignment_hint, exec); if (err != 0) { // the caller wants all commit errors to exit with the specified mesg: warn_fail_commit_memory(addr, bytes, alignment_hint, exec, err); ! vm_exit_out_of_memory(bytes, OOM_MMAP_ERROR, "%s", mesg); } } // Uncommit the pages in a specified region. void os::pd_free_memory(char* addr, size_t bytes, size_t alignment_hint) {
*** 2967,2981 **** } return false; } bool os::Solaris::setup_large_pages(caddr_t start, size_t bytes, size_t align) { ! assert(is_valid_page_size(align), err_msg(SIZE_FORMAT " is not a valid page size", align)); assert(is_ptr_aligned((void*) start, align), ! err_msg(PTR_FORMAT " is not aligned to " SIZE_FORMAT, p2i((void*) start), align)); assert(is_size_aligned(bytes, align), ! err_msg(SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, align)); // Signal to OS that we want large pages for addresses // from addr, addr + bytes struct memcntl_mha mpss_struct; mpss_struct.mha_cmd = MHA_MAPSIZE_VA; --- 2966,2980 ---- } return false; } bool os::Solaris::setup_large_pages(caddr_t start, size_t bytes, size_t align) { ! assert(is_valid_page_size(align), SIZE_FORMAT " is not a valid page size", align); assert(is_ptr_aligned((void*) start, align), ! PTR_FORMAT " is not aligned to " SIZE_FORMAT, p2i((void*) start), align); assert(is_size_aligned(bytes, align), ! SIZE_FORMAT " is not aligned to " SIZE_FORMAT, bytes, align); // Signal to OS that we want large pages for addresses // from addr, addr + bytes struct memcntl_mha mpss_struct; mpss_struct.mha_cmd = MHA_MAPSIZE_VA;
*** 3954,3965 **** vm_exit_during_initialization("Signal chaining not allowed for VM interrupt signal, try -XX:+UseAltSigs."); } // libjsig also interposes the sigaction() call below and saves the // old sigaction on it own. } else { ! fatal(err_msg("Encountered unexpected pre-existing sigaction handler " ! "%#lx for signal %d.", (long)oldhand, sig)); } } struct sigaction sigAct; sigfillset(&(sigAct.sa_mask)); --- 3953,3964 ---- vm_exit_during_initialization("Signal chaining not allowed for VM interrupt signal, try -XX:+UseAltSigs."); } // libjsig also interposes the sigaction() call below and saves the // old sigaction on it own. } else { ! fatal("Encountered unexpected pre-existing sigaction handler " ! "%#lx for signal %d.", (long)oldhand, sig); } } struct sigaction sigAct; sigfillset(&(sigAct.sa_mask));
*** 4401,4412 **** init_random(1234567); page_size = sysconf(_SC_PAGESIZE); if (page_size == -1) { ! fatal(err_msg("os_solaris.cpp: os::init: sysconf failed (%s)", ! strerror(errno))); } init_page_sizes((size_t) page_size); Solaris::initialize_system_info(); --- 4400,4410 ---- init_random(1234567); page_size = sysconf(_SC_PAGESIZE); if (page_size == -1) { ! fatal("os_solaris.cpp: os::init: sysconf failed (%s)", strerror(errno)); } init_page_sizes((size_t) page_size); Solaris::initialize_system_info();
*** 4414,4424 **** // if we need them. Solaris::misc_sym_init(); int fd = ::open("/dev/zero", O_RDWR); if (fd < 0) { ! fatal(err_msg("os::init: cannot open /dev/zero (%s)", strerror(errno))); } else { Solaris::set_dev_zero_fd(fd); // Close on exec, child won't inherit. fcntl(fd, F_SETFD, FD_CLOEXEC); --- 4412,4422 ---- // if we need them. Solaris::misc_sym_init(); int fd = ::open("/dev/zero", O_RDWR); if (fd < 0) { ! fatal("os::init: cannot open /dev/zero (%s)", strerror(errno)); } else { Solaris::set_dev_zero_fd(fd); // Close on exec, child won't inherit. fcntl(fd, F_SETFD, FD_CLOEXEC);
< prev index next >