hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
changeset 30129 351788433103
parent 29573 2d800e5d575f
child 32080 9d2ace436482
equal deleted inserted replaced
30128:b5e4e8a58b0b 30129:351788433103
    57 #include "runtime/thread.inline.hpp"
    57 #include "runtime/thread.inline.hpp"
    58 #include "runtime/timer.hpp"
    58 #include "runtime/timer.hpp"
    59 #include "utilities/events.hpp"
    59 #include "utilities/events.hpp"
    60 #include "utilities/vmError.hpp"
    60 #include "utilities/vmError.hpp"
    61 
    61 
       
    62 // See stubGenerator_zero.cpp
       
    63 #include <setjmp.h>
       
    64 extern sigjmp_buf* get_jmp_buf_for_continuation();
       
    65 
    62 address os::current_stack_pointer() {
    66 address os::current_stack_pointer() {
    63   address dummy = (address) &dummy;
    67   address dummy = (address) &dummy;
    64   return dummy;
    68   return dummy;
    65 }
    69 }
    66 
    70 
   132 
   136 
   133   Thread* t = ThreadLocalStorage::get_thread_slow();
   137   Thread* t = ThreadLocalStorage::get_thread_slow();
   134 
   138 
   135   SignalHandlerMark shm(t);
   139   SignalHandlerMark shm(t);
   136 
   140 
       
   141   // handle SafeFetch faults
       
   142   if (sig == SIGSEGV || sig == SIGBUS) {
       
   143     sigjmp_buf* const pjb = get_jmp_buf_for_continuation();
       
   144     if (pjb) {
       
   145       siglongjmp(*pjb, 1);
       
   146     }
       
   147   }
       
   148 
   137   // Note: it's not uncommon that JNI code uses signal/sigset to
   149   // Note: it's not uncommon that JNI code uses signal/sigset to
   138   // install then restore certain signal handler (e.g. to temporarily
   150   // install then restore certain signal handler (e.g. to temporarily
   139   // block SIGPIPE, or have a SIGILL handler when detecting CPU
   151   // block SIGPIPE, or have a SIGILL handler when detecting CPU
   140   // type). When that happens, JVM_handle_bsd_signal() might be
   152   // type). When that happens, JVM_handle_bsd_signal() might be
   141   // invoked with junk info/ucVoid. To avoid unnecessary crash when
   153   // invoked with junk info/ucVoid. To avoid unnecessary crash when