2137 ConstantPoolCacheEntry::flags_offset()); |
2137 ConstantPoolCacheEntry::flags_offset()); |
2138 // access constant pool cache fields |
2138 // access constant pool cache fields |
2139 const int index_offset = in_bytes(ConstantPoolCache::base_offset() + |
2139 const int index_offset = in_bytes(ConstantPoolCache::base_offset() + |
2140 ConstantPoolCacheEntry::f2_offset()); |
2140 ConstantPoolCacheEntry::f2_offset()); |
2141 |
2141 |
2142 size_t index_size = (is_invokedynamic ? sizeof(u4) : sizeof(u2)); |
2142 size_t index_size = (is_invokedynamic ? sizeof(u4) : sizeof(u2)); |
2143 resolve_cache_and_index(byte_no, cache, index, index_size); |
2143 resolve_cache_and_index(byte_no, cache, index, index_size); |
2144 __ movptr(method, Address(cache, index, Address::times_ptr, method_offset)); |
2144 __ movptr(method, Address(cache, index, Address::times_ptr, method_offset)); |
2145 |
2145 |
2146 if (itable_index != noreg) { |
2146 if (itable_index != noreg) { |
2147 __ movptr(itable_index, Address(cache, index, Address::times_ptr, index_offset)); |
2147 __ movptr(itable_index, Address(cache, index, Address::times_ptr, index_offset)); |
2874 // Push the appendix as a trailing parameter. |
2874 // Push the appendix as a trailing parameter. |
2875 // This must be done before we get the receiver, |
2875 // This must be done before we get the receiver, |
2876 // since the parameter_size includes it. |
2876 // since the parameter_size includes it. |
2877 __ push(rbx); |
2877 __ push(rbx); |
2878 __ mov(rbx, index); |
2878 __ mov(rbx, index); |
|
2879 assert(ConstantPoolCacheEntry::_indy_resolved_references_appendix_offset == 0, "appendix expected at index+0"); |
2879 __ load_resolved_reference_at_index(index, rbx); |
2880 __ load_resolved_reference_at_index(index, rbx); |
2880 __ pop(rbx); |
2881 __ pop(rbx); |
2881 __ push(index); // push appendix (MethodType, CallSite, etc.) |
2882 __ push(index); // push appendix (MethodType, CallSite, etc.) |
2882 __ bind(L_no_push); |
2883 __ bind(L_no_push); |
2883 } |
2884 } |
3091 } |
3092 } |
3092 |
3093 |
3093 void TemplateTable::invokehandle(int byte_no) { |
3094 void TemplateTable::invokehandle(int byte_no) { |
3094 transition(vtos, vtos); |
3095 transition(vtos, vtos); |
3095 assert(byte_no == f1_byte, "use this argument"); |
3096 assert(byte_no == f1_byte, "use this argument"); |
3096 const Register rbx_method = rbx; // (from f2) |
3097 const Register rbx_method = rbx; |
3097 const Register rax_mtype = rax; // (from f1) |
3098 const Register rax_mtype = rax; |
3098 const Register rcx_recv = rcx; |
3099 const Register rcx_recv = rcx; |
3099 const Register rdx_flags = rdx; |
3100 const Register rdx_flags = rdx; |
3100 |
3101 |
3101 if (!EnableInvokeDynamic) { |
3102 if (!EnableInvokeDynamic) { |
3102 // rewriter does not generate this bytecode |
3103 // rewriter does not generate this bytecode |
3103 __ should_not_reach_here(); |
3104 __ should_not_reach_here(); |
3104 return; |
3105 return; |
3105 } |
3106 } |
3106 |
3107 |
3107 prepare_invoke(byte_no, |
3108 prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv); |
3108 rbx_method, rax_mtype, // get f2 Method*, f1 MethodType |
|
3109 rcx_recv); |
|
3110 __ verify_method_ptr(rbx_method); |
3109 __ verify_method_ptr(rbx_method); |
3111 __ verify_oop(rcx_recv); |
3110 __ verify_oop(rcx_recv); |
3112 __ null_check(rcx_recv); |
3111 __ null_check(rcx_recv); |
|
3112 |
|
3113 // rax: MethodType object (from cpool->resolved_references[f1], if necessary) |
|
3114 // rbx: MH.invokeExact_MT method (from f2) |
3113 |
3115 |
3114 // Note: rax_mtype is already pushed (if necessary) by prepare_invoke |
3116 // Note: rax_mtype is already pushed (if necessary) by prepare_invoke |
3115 |
3117 |
3116 // FIXME: profile the LambdaForm also |
3118 // FIXME: profile the LambdaForm also |
3117 __ profile_final_call(rax); |
3119 __ profile_final_call(rax); |
3138 const Register rbx_method = rbx; |
3140 const Register rbx_method = rbx; |
3139 const Register rax_callsite = rax; |
3141 const Register rax_callsite = rax; |
3140 |
3142 |
3141 prepare_invoke(byte_no, rbx_method, rax_callsite); |
3143 prepare_invoke(byte_no, rbx_method, rax_callsite); |
3142 |
3144 |
3143 // rax: CallSite object (from cpool->resolved_references[]) |
3145 // rax: CallSite object (from cpool->resolved_references[f1]) |
3144 // rbx: MH.linkToCallSite method (from f2) |
3146 // rbx: MH.linkToCallSite method (from f2) |
3145 |
3147 |
3146 // Note: rax_callsite is already pushed by prepare_invoke |
3148 // Note: rax_callsite is already pushed by prepare_invoke |
3147 |
3149 |
3148 // %%% should make a type profile for any invokedynamic that takes a ref argument |
3150 // %%% should make a type profile for any invokedynamic that takes a ref argument |