src/cpu/x86/vm/frame_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8068945-8u-patched Cdiff src/cpu/x86/vm/frame_x86.cpp

src/cpu/x86/vm/frame_x86.cpp

Print this page
rev 7386 : 8068945: Use RBP register as proper frame pointer in JIT compiled code on x86
Summary: Introduce the PreserveFramePointer flag to control if RBP is used as the frame pointer or as a general purpose register.
Reviewed-by: kvn, roland, dlong, enevill, shade

*** 214,224 **** } if (sender_blob->is_nmethod()) { nmethod* nm = sender_blob->as_nmethod_or_null(); if (nm != NULL) { ! if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc)) { return false; } } } --- 214,225 ---- } if (sender_blob->is_nmethod()) { nmethod* nm = sender_blob->as_nmethod_or_null(); if (nm != NULL) { ! if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) || ! nm->method()->is_method_handle_intrinsic()) { return false; } } }
*** 381,430 **** //------------------------------------------------------------------------------ // frame::verify_deopt_original_pc // // Verifies the calculated original PC of a deoptimization PC for the ! // given unextended SP. The unextended SP might also be the saved SP ! // for MethodHandle call sites. #ifdef ASSERT ! void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp, bool is_method_handle_return) { frame fr; // This is ugly but it's better than to change {get,set}_original_pc // to take an SP value as argument. And it's only a debugging // method anyway. fr._unextended_sp = unextended_sp; address original_pc = nm->get_original_pc(&fr); assert(nm->insts_contains(original_pc), "original PC must be in nmethod"); - assert(nm->is_method_handle_return(original_pc) == is_method_handle_return, "must be"); } #endif //------------------------------------------------------------------------------ // frame::adjust_unextended_sp void frame::adjust_unextended_sp() { ! // If we are returning to a compiled MethodHandle call site, the ! // saved_fp will in fact be a saved value of the unextended SP. The ! // simplest way to tell whether we are returning to such a call site ! // is as follows: nmethod* sender_nm = (_cb == NULL) ? NULL : _cb->as_nmethod_or_null(); if (sender_nm != NULL) { ! // If the sender PC is a deoptimization point, get the original ! // PC. For MethodHandle call site the unextended_sp is stored in ! // saved_fp. ! if (sender_nm->is_deopt_mh_entry(_pc)) { ! DEBUG_ONLY(verify_deopt_mh_original_pc(sender_nm, _fp)); ! _unextended_sp = _fp; ! } ! else if (sender_nm->is_deopt_entry(_pc)) { DEBUG_ONLY(verify_deopt_original_pc(sender_nm, _unextended_sp)); } - else if (sender_nm->is_method_handle_return(_pc)) { - _unextended_sp = _fp; - } } } //------------------------------------------------------------------------------ // frame::update_map_with_saved_link --- 382,420 ---- //------------------------------------------------------------------------------ // frame::verify_deopt_original_pc // // Verifies the calculated original PC of a deoptimization PC for the ! // given unextended SP. #ifdef ASSERT ! void frame::verify_deopt_original_pc(nmethod* nm, intptr_t* unextended_sp) { frame fr; // This is ugly but it's better than to change {get,set}_original_pc // to take an SP value as argument. And it's only a debugging // method anyway. fr._unextended_sp = unextended_sp; address original_pc = nm->get_original_pc(&fr); assert(nm->insts_contains(original_pc), "original PC must be in nmethod"); } #endif //------------------------------------------------------------------------------ // frame::adjust_unextended_sp void frame::adjust_unextended_sp() { ! // On x86, sites calling method handle intrinsics and lambda forms are treated ! // as any other call site. Therefore, no special action is needed when we are ! // returning to any of these call sites. nmethod* sender_nm = (_cb == NULL) ? NULL : _cb->as_nmethod_or_null(); if (sender_nm != NULL) { ! // If the sender PC is a deoptimization point, get the original PC. ! if (sender_nm->is_deopt_entry(_pc) || ! sender_nm->is_deopt_mh_entry(_pc)) { DEBUG_ONLY(verify_deopt_original_pc(sender_nm, _unextended_sp)); } } } //------------------------------------------------------------------------------ // frame::update_map_with_saved_link
src/cpu/x86/vm/frame_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File