700 assert(! is_compiled_frame(), "unknown compiled frame size"); 701 return fp(); 702 } 703 704 #ifndef PRODUCT 705 // This is a generic constructor which is only used by pns() in debug.cpp. 706 frame::frame(void* sp, void* fp, void* pc) { 707 init((intptr_t*)sp, (intptr_t*)fp, (address)pc); 708 } 709 710 void frame::pd_ps() {} 711 #endif 712 713 // Check for a method with scalarized value type arguments that needs 714 // a stack repair and return the repaired sender stack pointer. 715 intptr_t* frame::repair_sender_sp(intptr_t* sender_sp, intptr_t** saved_fp_addr) const { 716 CompiledMethod* cm = _cb->as_compiled_method_or_null(); 717 if (cm != NULL && cm->needs_stack_repair()) { 718 // The stack increment resides just below the saved rbp on the stack 719 // and does not account for the return address. 720 intptr_t* sp_inc_addr = (intptr_t*) (saved_fp_addr - 1); 721 int sp_inc = (*sp_inc_addr) / wordSize; 722 int real_frame_size = sp_inc; 723 if (!cm->is_compiled_by_c1()) { 724 // Add size of return address (C1 already includes the RA size) 725 real_frame_size += 1; 726 } 727 assert(real_frame_size >= _cb->frame_size(), "invalid frame size"); 728 sender_sp = unextended_sp() + real_frame_size; 729 } 730 return sender_sp; 731 } 732 733 void JavaFrameAnchor::make_walkable(JavaThread* thread) { 734 // last frame set? 735 if (last_Java_sp() == NULL) return; 736 // already walkable? 737 if (walkable()) return; 738 vmassert(Thread::current() == (Thread*)thread, "not current thread"); 739 vmassert(last_Java_sp() != NULL, "not called from Java code?"); 740 vmassert(last_Java_pc() == NULL, "already walkable"); 741 capture_last_Java_pc(); 742 vmassert(walkable(), "something went wrong"); | 700 assert(! is_compiled_frame(), "unknown compiled frame size"); 701 return fp(); 702 } 703 704 #ifndef PRODUCT 705 // This is a generic constructor which is only used by pns() in debug.cpp. 706 frame::frame(void* sp, void* fp, void* pc) { 707 init((intptr_t*)sp, (intptr_t*)fp, (address)pc); 708 } 709 710 void frame::pd_ps() {} 711 #endif 712 713 // Check for a method with scalarized value type arguments that needs 714 // a stack repair and return the repaired sender stack pointer. 715 intptr_t* frame::repair_sender_sp(intptr_t* sender_sp, intptr_t** saved_fp_addr) const { 716 CompiledMethod* cm = _cb->as_compiled_method_or_null(); 717 if (cm != NULL && cm->needs_stack_repair()) { 718 // The stack increment resides just below the saved rbp on the stack 719 // and does not account for the return address. 720 intptr_t* real_frame_size_addr = (intptr_t*) (saved_fp_addr - 1); 721 int real_frame_size = (*real_frame_size_addr) / wordSize; 722 if (!cm->is_compiled_by_c1()) { 723 // Add size of return address (C1 already includes the RA size) 724 real_frame_size += 1; 725 } 726 assert(real_frame_size >= _cb->frame_size(), "invalid frame size"); 727 sender_sp = unextended_sp() + real_frame_size; 728 } 729 return sender_sp; 730 } 731 732 void JavaFrameAnchor::make_walkable(JavaThread* thread) { 733 // last frame set? 734 if (last_Java_sp() == NULL) return; 735 // already walkable? 736 if (walkable()) return; 737 vmassert(Thread::current() == (Thread*)thread, "not current thread"); 738 vmassert(last_Java_sp() != NULL, "not called from Java code?"); 739 vmassert(last_Java_pc() == NULL, "already walkable"); 740 capture_last_Java_pc(); 741 vmassert(walkable(), "something went wrong"); |