src/cpu/x86/vm/c1_Runtime1_x86.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6930772 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/c1_Runtime1_x86.cpp

Print this page




 765   // Only RAX and RSI are valid at this time, all other registers have been destroyed by the call.
 766   __ invalidate_registers(false, true, true, true, false, true);
 767 
 768   // move result of call into correct register
 769   __ movptr(handler_addr, rax);
 770 
 771   // Restore exception oop to RAX (required convention of exception handler).
 772   __ movptr(exception_oop, exception_oop_callee_saved);
 773 
 774   // verify that there is really a valid exception in rax
 775   __ verify_not_null_oop(exception_oop);
 776 
 777   // get throwing pc (= return address).
 778   // rdx has been destroyed by the call, so it must be set again
 779   // the pop is also necessary to simulate the effect of a ret(0)
 780   __ pop(exception_pc);
 781 
 782   // Restore SP from BP if the exception PC is a MethodHandle call site.
 783   NOT_LP64(__ get_thread(thread);)
 784   __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0);
 785   __ cmovptr(Assembler::notEqual, rsp, rbp);
 786 
 787   // continue at exception handler (return address removed)
 788   // note: do *not* remove arguments when unwinding the
 789   //       activation since the caller assumes having
 790   //       all arguments on the stack when entering the
 791   //       runtime to determine the exception handler
 792   //       (GC happens at call site with arguments!)
 793   // rax: exception oop
 794   // rdx: throwing pc
 795   // rbx: exception handler
 796   __ jmp(handler_addr);
 797 }
 798 
 799 
 800 OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
 801   // use the maximum number of runtime-arguments here because it is difficult to
 802   // distinguish each RT-Call.
 803   // Note: This number affects also the RT-Call in generate_handle_exception because
 804   //       the oop-map is shared for all calls.
 805   const int num_rt_args = 2;  // thread + dummy




 765   // Only RAX and RSI are valid at this time, all other registers have been destroyed by the call.
 766   __ invalidate_registers(false, true, true, true, false, true);
 767 
 768   // move result of call into correct register
 769   __ movptr(handler_addr, rax);
 770 
 771   // Restore exception oop to RAX (required convention of exception handler).
 772   __ movptr(exception_oop, exception_oop_callee_saved);
 773 
 774   // verify that there is really a valid exception in rax
 775   __ verify_not_null_oop(exception_oop);
 776 
 777   // get throwing pc (= return address).
 778   // rdx has been destroyed by the call, so it must be set again
 779   // the pop is also necessary to simulate the effect of a ret(0)
 780   __ pop(exception_pc);
 781 
 782   // Restore SP from BP if the exception PC is a MethodHandle call site.
 783   NOT_LP64(__ get_thread(thread);)
 784   __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0);
 785   __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save);
 786 
 787   // continue at exception handler (return address removed)
 788   // note: do *not* remove arguments when unwinding the
 789   //       activation since the caller assumes having
 790   //       all arguments on the stack when entering the
 791   //       runtime to determine the exception handler
 792   //       (GC happens at call site with arguments!)
 793   // rax: exception oop
 794   // rdx: throwing pc
 795   // rbx: exception handler
 796   __ jmp(handler_addr);
 797 }
 798 
 799 
 800 OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) {
 801   // use the maximum number of runtime-arguments here because it is difficult to
 802   // distinguish each RT-Call.
 803   // Note: This number affects also the RT-Call in generate_handle_exception because
 804   //       the oop-map is shared for all calls.
 805   const int num_rt_args = 2;  // thread + dummy


src/cpu/x86/vm/c1_Runtime1_x86.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File