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