< prev index next >

src/hotspot/os_cpu/linux_x86/thread_linux_x86.cpp

Print this page




  57   if (isInJava) {
  58     ucontext_t* uc = (ucontext_t*) ucontext;
  59 
  60     intptr_t* ret_fp;
  61     intptr_t* ret_sp;
  62     ExtendedPC addr = os::Linux::fetch_frame_from_ucontext(this, uc,
  63       &ret_sp, &ret_fp);
  64     if (addr.pc() == NULL || ret_sp == NULL ) {
  65       // ucontext wasn't useful
  66       return false;
  67     }
  68 
  69     if (MetaspaceShared::is_in_trampoline_frame(addr.pc())) {
  70       // In the middle of a trampoline call. Bail out for safety.
  71       // This happens rarely so shouldn't affect profiling.
  72       return false;
  73     }
  74 
  75     frame ret_frame(ret_sp, ret_fp, addr.pc());
  76     if (!ret_frame.safe_for_sender(jt)) {
  77 #if defined(COMPILER2) || INCLUDE_JVMCI
  78       // C2 and JVMCI use ebp as a general register see if NULL fp helps
  79       frame ret_frame2(ret_sp, NULL, addr.pc());
  80       if (!ret_frame2.safe_for_sender(jt)) {
  81         // nothing else to try if the frame isn't good
  82         return false;
  83       }
  84       ret_frame = ret_frame2;
  85 #else
  86       // nothing else to try if the frame isn't good
  87       return false;
  88 #endif /* COMPILER2 || INCLUDE_JVMCI */
  89     }
  90     *fr_addr = ret_frame;
  91     return true;
  92   }
  93 
  94   // nothing else to try
  95   return false;
  96 }
  97 
  98 void JavaThread::cache_global_variables() { }
  99 


  57   if (isInJava) {
  58     ucontext_t* uc = (ucontext_t*) ucontext;
  59 
  60     intptr_t* ret_fp;
  61     intptr_t* ret_sp;
  62     ExtendedPC addr = os::Linux::fetch_frame_from_ucontext(this, uc,
  63       &ret_sp, &ret_fp);
  64     if (addr.pc() == NULL || ret_sp == NULL ) {
  65       // ucontext wasn't useful
  66       return false;
  67     }
  68 
  69     if (MetaspaceShared::is_in_trampoline_frame(addr.pc())) {
  70       // In the middle of a trampoline call. Bail out for safety.
  71       // This happens rarely so shouldn't affect profiling.
  72       return false;
  73     }
  74 
  75     frame ret_frame(ret_sp, ret_fp, addr.pc());
  76     if (!ret_frame.safe_for_sender(jt)) {
  77 #if COMPILER2_OR_JVMCI
  78       // C2 and JVMCI use ebp as a general register see if NULL fp helps
  79       frame ret_frame2(ret_sp, NULL, addr.pc());
  80       if (!ret_frame2.safe_for_sender(jt)) {
  81         // nothing else to try if the frame isn't good
  82         return false;
  83       }
  84       ret_frame = ret_frame2;
  85 #else
  86       // nothing else to try if the frame isn't good
  87       return false;
  88 #endif // COMPILER2_OR_JVMCI
  89     }
  90     *fr_addr = ret_frame;
  91     return true;
  92   }
  93 
  94   // nothing else to try
  95   return false;
  96 }
  97 
  98 void JavaThread::cache_global_variables() { }
  99 
< prev index next >