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::Bsd::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 if (MetaspaceShared::is_in_trampoline_frame(addr.pc())) { 69 // In the middle of a trampoline call. Bail out for safety. 70 // This happens rarely so shouldn't affect profiling. 71 return false; 72 } 73 74 frame ret_frame(ret_sp, ret_fp, addr.pc()); 75 if (!ret_frame.safe_for_sender(jt)) { 76 #if defined(COMPILER2) || INCLUDE_JVMCI 77 // C2 and JVMCI use ebp as a general register see if NULL fp helps 78 frame ret_frame2(ret_sp, NULL, addr.pc()); 79 if (!ret_frame2.safe_for_sender(jt)) { 80 // nothing else to try if the frame isn't good 81 return false; 82 } 83 ret_frame = ret_frame2; 84 #else 85 // nothing else to try if the frame isn't good 86 return false; 87 #endif /* COMPILER2 || INCLUDE_JVMCI */ 88 } 89 *fr_addr = ret_frame; 90 return true; 91 } 92 93 // nothing else to try 94 return false; 95 } 96 97 void JavaThread::cache_global_variables() { } | 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::Bsd::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 if (MetaspaceShared::is_in_trampoline_frame(addr.pc())) { 69 // In the middle of a trampoline call. Bail out for safety. 70 // This happens rarely so shouldn't affect profiling. 71 return false; 72 } 73 74 frame ret_frame(ret_sp, ret_fp, addr.pc()); 75 if (!ret_frame.safe_for_sender(jt)) { 76 #if COMPILER2_OR_JVMCI 77 // C2 and JVMCI use ebp as a general register see if NULL fp helps 78 frame ret_frame2(ret_sp, NULL, addr.pc()); 79 if (!ret_frame2.safe_for_sender(jt)) { 80 // nothing else to try if the frame isn't good 81 return false; 82 } 83 ret_frame = ret_frame2; 84 #else 85 // nothing else to try if the frame isn't good 86 return false; 87 #endif // COMPILER2_OR_JVMCI 88 } 89 *fr_addr = ret_frame; 90 return true; 91 } 92 93 // nothing else to try 94 return false; 95 } 96 97 void JavaThread::cache_global_variables() { } |