206 // O0: used as temp to hold mh or receiver |
206 // O0: used as temp to hold mh or receiver |
207 // O1, O4: garbage temps, blown away |
207 // O1, O4: garbage temps, blown away |
208 Register O1_scratch = O1; |
208 Register O1_scratch = O1; |
209 Register O4_param_size = O4; // size of parameters |
209 Register O4_param_size = O4; // size of parameters |
210 |
210 |
211 address code_start = __ pc(); |
|
212 |
|
213 // here's where control starts out: |
211 // here's where control starts out: |
214 __ align(CodeEntryAlignment); |
212 __ align(CodeEntryAlignment); |
215 address entry_point = __ pc(); |
213 address entry_point = __ pc(); |
216 |
214 |
217 if (VerifyMethodHandles) { |
215 if (VerifyMethodHandles) { |
250 } |
248 } |
251 |
249 |
252 // O4_first_arg_addr is live! |
250 // O4_first_arg_addr is live! |
253 |
251 |
254 if (TraceMethodHandles) { |
252 if (TraceMethodHandles) { |
255 const char* name = vmIntrinsics::name_at(iid); |
|
256 if (*name == '_') name += 1; |
|
257 const size_t len = strlen(name) + 50; |
|
258 char* qname = NEW_C_HEAP_ARRAY(char, len, mtInternal); |
|
259 const char* suffix = ""; |
|
260 if (vmIntrinsics::method_for(iid) == NULL || |
|
261 !vmIntrinsics::method_for(iid)->access_flags().is_public()) { |
|
262 if (is_signature_polymorphic_static(iid)) |
|
263 suffix = "/static"; |
|
264 else |
|
265 suffix = "/private"; |
|
266 } |
|
267 jio_snprintf(qname, len, "MethodHandle::interpreter_entry::%s%s", name, suffix); |
|
268 if (O0_mh != noreg) |
253 if (O0_mh != noreg) |
269 __ mov(O0_mh, G3_method_handle); // make stub happy |
254 __ mov(O0_mh, G3_method_handle); // make stub happy |
270 trace_method_handle(_masm, qname); |
255 trace_method_handle_interpreter_entry(_masm, iid); |
271 } |
256 } |
272 |
257 |
273 if (iid == vmIntrinsics::_invokeBasic) { |
258 if (iid == vmIntrinsics::_invokeBasic) { |
274 generate_method_handle_dispatch(_masm, iid, O0_mh, noreg, not_for_compiler_entry); |
259 generate_method_handle_dispatch(_masm, iid, O0_mh, noreg, not_for_compiler_entry); |
275 |
260 |
283 } |
268 } |
284 Register G5_member = G5_method; // MemberName ptr; incoming method ptr is dead now |
269 Register G5_member = G5_method; // MemberName ptr; incoming method ptr is dead now |
285 __ ld_ptr(__ argument_address(constant(0)), G5_member); |
270 __ ld_ptr(__ argument_address(constant(0)), G5_member); |
286 __ add(Gargs, Interpreter::stackElementSize, Gargs); |
271 __ add(Gargs, Interpreter::stackElementSize, Gargs); |
287 generate_method_handle_dispatch(_masm, iid, O0_recv, G5_member, not_for_compiler_entry); |
272 generate_method_handle_dispatch(_masm, iid, O0_recv, G5_member, not_for_compiler_entry); |
288 } |
|
289 |
|
290 if (PrintMethodHandleStubs) { |
|
291 address code_end = __ pc(); |
|
292 tty->print_cr("--------"); |
|
293 tty->print_cr("method handle interpreter entry for %s", vmIntrinsics::name_at(iid)); |
|
294 Disassembler::decode(code_start, code_end); |
|
295 tty->cr(); |
|
296 } |
273 } |
297 |
274 |
298 return entry_point; |
275 return entry_point; |
299 } |
276 } |
300 |
277 |