28 #include "runtime/thread.inline.hpp" 29 30 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is 31 // currently interrupted by SIGPROF 32 bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, 33 void* ucontext, bool isInJava) { 34 assert(Thread::current() == this, "caller must be current thread"); 35 return pd_get_top_frame(fr_addr, ucontext, isInJava); 36 } 37 38 bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, 39 void* ucontext, bool isInJava) { 40 return pd_get_top_frame(fr_addr, ucontext, isInJava); 41 } 42 43 bool JavaThread::pd_get_top_frame(frame* fr_addr, 44 void* ucontext, bool isInJava) { 45 assert(this->is_Java_thread(), "must be JavaThread"); 46 JavaThread* jt = (JavaThread *)this; 47 48 // last_Java_frame is always walkable and safe use it if we have it 49 50 if (jt->has_last_Java_frame()) { 51 *fr_addr = jt->pd_last_frame(); 52 return true; 53 } 54 55 ucontext_t* uc = (ucontext_t*) ucontext; 56 57 // We always want to use the initial frame we create from the ucontext as 58 // it certainly signals where we currently are. However that frame may not 59 // be safe for calling sender. In that case if we have a last_Java_frame 60 // then the forte walker will switch to that frame as the virtual sender 61 // for the frame we create here which is not sender safe. 62 63 intptr_t* ret_fp; 64 intptr_t* ret_sp; 65 ExtendedPC addr = os::Solaris::fetch_frame_from_ucontext(this, uc, &ret_sp, &ret_fp); 66 67 // Something would really have to be screwed up to get a NULL pc 68 69 if (addr.pc() == NULL) { 70 assert(false, "NULL pc from signal handler!"); | 28 #include "runtime/thread.inline.hpp" 29 30 // For Forte Analyzer AsyncGetCallTrace profiling support - thread is 31 // currently interrupted by SIGPROF 32 bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, 33 void* ucontext, bool isInJava) { 34 assert(Thread::current() == this, "caller must be current thread"); 35 return pd_get_top_frame(fr_addr, ucontext, isInJava); 36 } 37 38 bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, 39 void* ucontext, bool isInJava) { 40 return pd_get_top_frame(fr_addr, ucontext, isInJava); 41 } 42 43 bool JavaThread::pd_get_top_frame(frame* fr_addr, 44 void* ucontext, bool isInJava) { 45 assert(this->is_Java_thread(), "must be JavaThread"); 46 JavaThread* jt = (JavaThread *)this; 47 48 // There is small window where last_Java_frame is not walkable or safe 49 if (jt->has_last_Java_frame() && jt->frame_anchor()->walkable()) { 50 *fr_addr = jt->pd_last_frame(); 51 return true; 52 } 53 54 ucontext_t* uc = (ucontext_t*) ucontext; 55 56 // We always want to use the initial frame we create from the ucontext as 57 // it certainly signals where we currently are. However that frame may not 58 // be safe for calling sender. In that case if we have a last_Java_frame 59 // then the forte walker will switch to that frame as the virtual sender 60 // for the frame we create here which is not sender safe. 61 62 intptr_t* ret_fp; 63 intptr_t* ret_sp; 64 ExtendedPC addr = os::Solaris::fetch_frame_from_ucontext(this, uc, &ret_sp, &ret_fp); 65 66 // Something would really have to be screwed up to get a NULL pc 67 68 if (addr.pc() == NULL) { 69 assert(false, "NULL pc from signal handler!"); |