comparison src/cpu/ppc/vm/runtime_ppc.cpp @ 14726:92aa6797d639

Backed out merge changeset: b51e29501f30 Backed out merge revision to its first parent (8f483e200405)
author Doug Simon <doug.simon@oracle.com>
date Mon, 24 Mar 2014 21:30:43 +0100
parents e5e8aa897002
children
comparison
equal deleted inserted replaced
14719:0bdd0d157040 14726:92aa6797d639
85 CodeBuffer buffer("exception_blob", 2048, 1024); 85 CodeBuffer buffer("exception_blob", 2048, 1024);
86 InterpreterMacroAssembler* masm = new InterpreterMacroAssembler(&buffer); 86 InterpreterMacroAssembler* masm = new InterpreterMacroAssembler(&buffer);
87 87
88 address start = __ pc(); 88 address start = __ pc();
89 89
90 int frame_size_in_bytes = frame::abi_reg_args_size; 90 int frame_size_in_bytes = frame::abi_112_size;
91 OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); 91 OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0);
92 92
93 // Exception pc is 'return address' for stack walker. 93 // Exception pc is 'return address' for stack walker.
94 __ std(R4_ARG2/*exception pc*/, _abi(lr), R1_SP); 94 __ std(R4_ARG2/*exception pc*/, _abi(lr), R1_SP);
95 95
97 __ std(R3_ARG1/*exception oop*/, in_bytes(JavaThread::exception_oop_offset()), R16_thread); 97 __ std(R3_ARG1/*exception oop*/, in_bytes(JavaThread::exception_oop_offset()), R16_thread);
98 __ std(R4_ARG2/*exception pc*/, in_bytes(JavaThread::exception_pc_offset()), R16_thread); 98 __ std(R4_ARG2/*exception pc*/, in_bytes(JavaThread::exception_pc_offset()), R16_thread);
99 99
100 // Save callee-saved registers. 100 // Save callee-saved registers.
101 // Push a C frame for the exception blob. It is needed for the C call later on. 101 // Push a C frame for the exception blob. It is needed for the C call later on.
102 __ push_frame_reg_args(0, R11_scratch1); 102 __ push_frame_abi112(0, R11_scratch1);
103 103
104 // This call does all the hard work. It checks if an exception handler 104 // This call does all the hard work. It checks if an exception handler
105 // exists in the method. 105 // exists in the method.
106 // If so, it returns the handler address. 106 // If so, it returns the handler address.
107 // If not, it prepares for stack-unwinding, restoring the callee-save 107 // If not, it prepares for stack-unwinding, restoring the callee-save
108 // registers of the frame being removed. 108 // registers of the frame being removed.
109 __ set_last_Java_frame(/*sp=*/R1_SP, noreg); 109 __ set_last_Java_frame(/*sp=*/R1_SP, noreg);
110 110
111 __ mr(R3_ARG1, R16_thread); 111 __ mr(R3_ARG1, R16_thread);
112 #if defined(ABI_ELFv2)
113 __ call_c((address) OptoRuntime::handle_exception_C, relocInfo::none);
114 #else
115 __ call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, OptoRuntime::handle_exception_C), 112 __ call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, OptoRuntime::handle_exception_C),
116 relocInfo::none); 113 relocInfo::none);
117 #endif
118 address calls_return_pc = __ last_calls_return_pc(); 114 address calls_return_pc = __ last_calls_return_pc();
119 # ifdef ASSERT 115 # ifdef ASSERT
120 __ cmpdi(CCR0, R3_RET, 0); 116 __ cmpdi(CCR0, R3_RET, 0);
121 __ asm_assert_ne("handle_exception_C must not return NULL", 0x601); 117 __ asm_assert_ne("handle_exception_C must not return NULL", 0x601);
122 # endif 118 # endif
164 160
165 // Same as above, but also set sp to unextended_sp. 161 // Same as above, but also set sp to unextended_sp.
166 __ bind(mh_callsite); 162 __ bind(mh_callsite);
167 __ mr(R31, R3_RET); // Save branch address. 163 __ mr(R31, R3_RET); // Save branch address.
168 __ mr(R3_ARG1, R16_thread); 164 __ mr(R3_ARG1, R16_thread);
169 #if defined(ABI_ELFv2)
170 __ call_c((address) adjust_SP_for_methodhandle_callsite, relocInfo::none);
171 #else
172 __ call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, adjust_SP_for_methodhandle_callsite), relocInfo::none); 165 __ call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, adjust_SP_for_methodhandle_callsite), relocInfo::none);
173 #endif
174 // Returns unextended_sp in R3_RET. 166 // Returns unextended_sp in R3_RET.
175 167
176 __ mtctr(R31); // Move address of exception handler to SR_CTR. 168 __ mtctr(R31); // Move address of exception handler to SR_CTR.
177 __ reset_last_Java_frame(); 169 __ reset_last_Java_frame();
178 170