src/cpu/sparc/vm/frame_sparc.cpp

Print this page
rev 7023 : 8058345: Refactor native stack printing from vmError.cpp to debug.cpp to make it available in gdb as well
Summary: Also fix stack trace on x86 to enable walking of runtime stubs and native wrappers


 402 
 403   if (younger_frame_is_interpreted) {
 404     // compute adjustment to this frame's SP made by its interpreted callee
 405     _sp_adjustment_by_callee = (intptr_t*) ((intptr_t) younger_sp[I5_savedSP->sp_offset_in_saved_window()] + STACK_BIAS) - sp;
 406   }
 407 
 408   // It is important that the frame is fully constructed when we do
 409   // this lookup as get_deopt_original_pc() needs a correct value for
 410   // unextended_sp() which uses _sp_adjustment_by_callee.
 411   if (_pc != NULL) {
 412     address original_pc = nmethod::get_deopt_original_pc(this);
 413     if (original_pc != NULL) {
 414       _pc = original_pc;
 415       _deopt_state = is_deoptimized;
 416     } else {
 417       _deopt_state = not_deoptimized;
 418     }
 419   }
 420 }
 421 

















 422 bool frame::is_interpreted_frame() const  {
 423   return Interpreter::contains(pc());
 424 }
 425 
 426 // sender_sp
 427 
 428 intptr_t* frame::interpreter_frame_sender_sp() const {
 429   assert(is_interpreted_frame(), "interpreted frame expected");
 430   return fp();
 431 }
 432 
 433 #ifndef CC_INTERP
 434 void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) {
 435   assert(is_interpreted_frame(), "interpreted frame expected");
 436   Unimplemented();
 437 }
 438 #endif // CC_INTERP
 439 
 440 frame frame::sender_for_entry_frame(RegisterMap *map) const {
 441   assert(map != NULL, "map must be set");




 402 
 403   if (younger_frame_is_interpreted) {
 404     // compute adjustment to this frame's SP made by its interpreted callee
 405     _sp_adjustment_by_callee = (intptr_t*) ((intptr_t) younger_sp[I5_savedSP->sp_offset_in_saved_window()] + STACK_BIAS) - sp;
 406   }
 407 
 408   // It is important that the frame is fully constructed when we do
 409   // this lookup as get_deopt_original_pc() needs a correct value for
 410   // unextended_sp() which uses _sp_adjustment_by_callee.
 411   if (_pc != NULL) {
 412     address original_pc = nmethod::get_deopt_original_pc(this);
 413     if (original_pc != NULL) {
 414       _pc = original_pc;
 415       _deopt_state = is_deoptimized;
 416     } else {
 417       _deopt_state = not_deoptimized;
 418     }
 419   }
 420 }
 421 
 422 #ifndef PRODUCT
 423 // This is a generic constructor which is only used by pns() in debug.cpp.
 424 frame::frame(void* sp, void* fp, void* pc) {
 425   _sp = (intptr_t*)sp;
 426   _younger_sp = NULL;
 427   _pc = (address)pc;
 428   _sp_adjustment_by_callee = 0;
 429   if (_pc != NULL) {
 430     _cb = CodeCache::find_blob(_pc);
 431   }
 432   else {
 433     _cb == NULL;
 434   }
 435   _deopt_state = unknown;
 436 }
 437 #endif
 438 
 439 bool frame::is_interpreted_frame() const  {
 440   return Interpreter::contains(pc());
 441 }
 442 
 443 // sender_sp
 444 
 445 intptr_t* frame::interpreter_frame_sender_sp() const {
 446   assert(is_interpreted_frame(), "interpreted frame expected");
 447   return fp();
 448 }
 449 
 450 #ifndef CC_INTERP
 451 void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) {
 452   assert(is_interpreted_frame(), "interpreted frame expected");
 453   Unimplemented();
 454 }
 455 #endif // CC_INTERP
 456 
 457 frame frame::sender_for_entry_frame(RegisterMap *map) const {
 458   assert(map != NULL, "map must be set");