49 return true; 50 } 51 52 // At this point, we don't have a last_Java_frame, so 53 // we try to glean some information out of the ucontext 54 // if we were running Java code when SIGPROF came in. 55 if (isInJava) { 56 ucontext_t* uc = (ucontext_t*) ucontext; 57 58 intptr_t* ret_fp; 59 intptr_t* ret_sp; 60 ExtendedPC addr = os::Bsd::fetch_frame_from_ucontext(this, uc, 61 &ret_sp, &ret_fp); 62 if (addr.pc() == NULL || ret_sp == NULL ) { 63 // ucontext wasn't useful 64 return false; 65 } 66 67 frame ret_frame(ret_sp, ret_fp, addr.pc()); 68 if (!ret_frame.safe_for_sender(jt)) { 69 #ifdef COMPILER2 70 // C2 uses ebp as a general register see if NULL fp helps 71 frame ret_frame2(ret_sp, NULL, addr.pc()); 72 if (!ret_frame2.safe_for_sender(jt)) { 73 // nothing else to try if the frame isn't good 74 return false; 75 } 76 ret_frame = ret_frame2; 77 #else 78 // nothing else to try if the frame isn't good 79 return false; 80 #endif /* COMPILER2 */ 81 } 82 *fr_addr = ret_frame; 83 return true; 84 } 85 86 // nothing else to try 87 return false; 88 } 89 90 void JavaThread::cache_global_variables() { } | 49 return true; 50 } 51 52 // At this point, we don't have a last_Java_frame, so 53 // we try to glean some information out of the ucontext 54 // if we were running Java code when SIGPROF came in. 55 if (isInJava) { 56 ucontext_t* uc = (ucontext_t*) ucontext; 57 58 intptr_t* ret_fp; 59 intptr_t* ret_sp; 60 ExtendedPC addr = os::Bsd::fetch_frame_from_ucontext(this, uc, 61 &ret_sp, &ret_fp); 62 if (addr.pc() == NULL || ret_sp == NULL ) { 63 // ucontext wasn't useful 64 return false; 65 } 66 67 frame ret_frame(ret_sp, ret_fp, addr.pc()); 68 if (!ret_frame.safe_for_sender(jt)) { 69 #if defined(COMPILER2) || INCLUDE_JVMCI 70 // C2 and JVMCI use ebp as a general register see if NULL fp helps 71 frame ret_frame2(ret_sp, NULL, addr.pc()); 72 if (!ret_frame2.safe_for_sender(jt)) { 73 // nothing else to try if the frame isn't good 74 return false; 75 } 76 ret_frame = ret_frame2; 77 #else 78 // nothing else to try if the frame isn't good 79 return false; 80 #endif /* COMPILER2 || INCLUDE_JVMCI */ 81 } 82 *fr_addr = ret_frame; 83 return true; 84 } 85 86 // nothing else to try 87 return false; 88 } 89 90 void JavaThread::cache_global_variables() { } |