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

src/cpu/x86/vm/runtime_x86_32.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


 109   // registers of the frame being removed.
 110   //
 111   __ movptr(Address(rsp, thread_off * wordSize), rcx); // Thread is first argument
 112   __ set_last_Java_frame(rcx, noreg, noreg, NULL);
 113 
 114   __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, OptoRuntime::handle_exception_C)));
 115 
 116   // No registers to map, rbp is known implicitly
 117   oop_maps->add_gc_map( __ pc() - start,  new OopMap( framesize, 0 ));
 118   __ get_thread(rcx);
 119   __ reset_last_Java_frame(rcx, false, false);
 120 
 121   // Restore callee-saved registers
 122   __ movptr(rbp, Address(rsp, rbp_off * wordSize));
 123 
 124   __ addptr(rsp, return_off * wordSize);   // Epilog!
 125   __ pop(rdx); // Exception pc
 126 
 127   // rax: exception handler for given <exception oop/exception pc>
 128 
 129   // Restore SP from BP if the exception PC is a MethodHandle call site.
 130   __ cmpl(Address(rcx, JavaThread::is_method_handle_return_offset()), 0);
 131   __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save);
 132 
 133   // We have a handler in rax, (could be deopt blob)
 134   // rdx - throwing pc, deopt blob will need it.
 135 
 136   __ push(rax);
 137 
 138   // Get the exception
 139   __ movptr(rax, Address(rcx, JavaThread::exception_oop_offset()));
 140   // Get the exception pc in case we are deoptimized
 141   __ movptr(rdx, Address(rcx, JavaThread::exception_pc_offset()));
 142 #ifdef ASSERT
 143   __ movptr(Address(rcx, JavaThread::exception_handler_pc_offset()), NULL_WORD);
 144   __ movptr(Address(rcx, JavaThread::exception_pc_offset()), NULL_WORD);
 145 #endif
 146   // Clear the exception oop so GC no longer processes it as a root.
 147   __ movptr(Address(rcx, JavaThread::exception_oop_offset()), NULL_WORD);
 148 
 149   __ pop(rcx);
 150 
 151   // rax: exception oop
 152   // rcx: exception handler


 109   // registers of the frame being removed.
 110   //
 111   __ movptr(Address(rsp, thread_off * wordSize), rcx); // Thread is first argument
 112   __ set_last_Java_frame(rcx, noreg, noreg, NULL);
 113 
 114   __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, OptoRuntime::handle_exception_C)));
 115 
 116   // No registers to map, rbp is known implicitly
 117   oop_maps->add_gc_map( __ pc() - start,  new OopMap( framesize, 0 ));
 118   __ get_thread(rcx);
 119   __ reset_last_Java_frame(rcx, false, false);
 120 
 121   // Restore callee-saved registers
 122   __ movptr(rbp, Address(rsp, rbp_off * wordSize));
 123 
 124   __ addptr(rsp, return_off * wordSize);   // Epilog!
 125   __ pop(rdx); // Exception pc
 126 
 127   // rax: exception handler for given <exception oop/exception pc>
 128 




 129   // We have a handler in rax, (could be deopt blob)
 130   // rdx - throwing pc, deopt blob will need it.
 131 
 132   __ push(rax);
 133 
 134   // Get the exception
 135   __ movptr(rax, Address(rcx, JavaThread::exception_oop_offset()));
 136   // Get the exception pc in case we are deoptimized
 137   __ movptr(rdx, Address(rcx, JavaThread::exception_pc_offset()));
 138 #ifdef ASSERT
 139   __ movptr(Address(rcx, JavaThread::exception_handler_pc_offset()), NULL_WORD);
 140   __ movptr(Address(rcx, JavaThread::exception_pc_offset()), NULL_WORD);
 141 #endif
 142   // Clear the exception oop so GC no longer processes it as a root.
 143   __ movptr(Address(rcx, JavaThread::exception_oop_offset()), NULL_WORD);
 144 
 145   __ pop(rcx);
 146 
 147   // rax: exception oop
 148   // rcx: exception handler
src/cpu/x86/vm/runtime_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File