109 __ call(CAST_FROM_FN_PTR(address, OptoRuntime::handle_exception_C)); 110 if (pc_offset == -1) { 111 pc_offset = __ offset(); 112 } 113 114 // Set an oopmap for the call site. This oopmap will only be used if we 115 // are unwinding the stack. Hence, all locations will be dead. 116 // Callee-saved registers will be the same as the frame above (i.e., 117 // handle_exception_stub), since they were restored when we got the 118 // exception. 119 120 OopMapSet *oop_maps = new OopMapSet(); 121 oop_maps->add_gc_map(pc_offset - start, new OopMap(framesize_in_slots, 0)); 122 123 __ reset_last_Java_frame(Rtemp); 124 125 __ raw_pop(FP, LR); 126 127 // Restore SP from its saved reg (FP) if the exception PC is a MethodHandle call site. 128 __ ldr(Rtemp, Address(Rthread, JavaThread::is_method_handle_return_offset())); 129 #ifdef AARCH64 130 Label skip; 131 __ cbz(Rtemp, skip); 132 __ mov(SP, Rmh_SP_save); 133 __ bind(skip); 134 #else 135 __ cmp(Rtemp, 0); 136 __ mov(SP, Rmh_SP_save, ne); 137 #endif 138 139 // R0 contains handler address 140 // Since this may be the deopt blob we must set R5 to look like we returned 141 // from the original pc that threw the exception 142 143 __ ldr(Rexception_pc, Address(Rthread, JavaThread::exception_pc_offset())); // R5/R20 144 145 __ ldr(Rexception_obj, Address(Rthread, JavaThread::exception_oop_offset())); // R4/R19 146 __ mov(Rtemp, 0); 147 #ifdef ASSERT 148 __ str(Rtemp, Address(Rthread, JavaThread::exception_handler_pc_offset())); 149 __ str(Rtemp, Address(Rthread, JavaThread::exception_pc_offset())); 150 #endif 151 // Clear the exception oop so GC no longer processes it as a root. 152 __ str(Rtemp, Address(Rthread, JavaThread::exception_oop_offset())); 153 __ jump(R0); 154 155 // ------------- 156 // make sure all code is generated 157 masm->flush(); | 109 __ call(CAST_FROM_FN_PTR(address, OptoRuntime::handle_exception_C)); 110 if (pc_offset == -1) { 111 pc_offset = __ offset(); 112 } 113 114 // Set an oopmap for the call site. This oopmap will only be used if we 115 // are unwinding the stack. Hence, all locations will be dead. 116 // Callee-saved registers will be the same as the frame above (i.e., 117 // handle_exception_stub), since they were restored when we got the 118 // exception. 119 120 OopMapSet *oop_maps = new OopMapSet(); 121 oop_maps->add_gc_map(pc_offset - start, new OopMap(framesize_in_slots, 0)); 122 123 __ reset_last_Java_frame(Rtemp); 124 125 __ raw_pop(FP, LR); 126 127 // Restore SP from its saved reg (FP) if the exception PC is a MethodHandle call site. 128 __ ldr(Rtemp, Address(Rthread, JavaThread::is_method_handle_return_offset())); 129 __ cmp(Rtemp, 0); 130 __ mov(SP, Rmh_SP_save, ne); 131 132 // R0 contains handler address 133 // Since this may be the deopt blob we must set R5 to look like we returned 134 // from the original pc that threw the exception 135 136 __ ldr(Rexception_pc, Address(Rthread, JavaThread::exception_pc_offset())); // R5/R20 137 138 __ ldr(Rexception_obj, Address(Rthread, JavaThread::exception_oop_offset())); // R4/R19 139 __ mov(Rtemp, 0); 140 #ifdef ASSERT 141 __ str(Rtemp, Address(Rthread, JavaThread::exception_handler_pc_offset())); 142 __ str(Rtemp, Address(Rthread, JavaThread::exception_pc_offset())); 143 #endif 144 // Clear the exception oop so GC no longer processes it as a root. 145 __ str(Rtemp, Address(Rthread, JavaThread::exception_oop_offset())); 146 __ jump(R0); 147 148 // ------------- 149 // make sure all code is generated 150 masm->flush(); |