714 } |
714 } |
715 assert(site_index == InterpreterRuntime::bytecode(thread)->get_index_u4(bytecode), ""); |
715 assert(site_index == InterpreterRuntime::bytecode(thread)->get_index_u4(bytecode), ""); |
716 assert(constantPoolCacheOopDesc::is_secondary_index(site_index), "proper format"); |
716 assert(constantPoolCacheOopDesc::is_secondary_index(site_index), "proper format"); |
717 // there is a second CPC entries that is of interest; it caches signature info: |
717 // there is a second CPC entries that is of interest; it caches signature info: |
718 int main_index = pool->cache()->secondary_entry_at(site_index)->main_entry_index(); |
718 int main_index = pool->cache()->secondary_entry_at(site_index)->main_entry_index(); |
|
719 int pool_index = pool->cache()->entry_at(main_index)->constant_pool_index(); |
719 |
720 |
720 // first resolve the signature to a MH.invoke methodOop |
721 // first resolve the signature to a MH.invoke methodOop |
721 if (!pool->cache()->entry_at(main_index)->is_resolved(bytecode)) { |
722 if (!pool->cache()->entry_at(main_index)->is_resolved(bytecode)) { |
722 JvmtiHideSingleStepping jhss(thread); |
723 JvmtiHideSingleStepping jhss(thread); |
723 CallInfo callinfo; |
724 CallInfo callinfo; |
738 oop f1_value = pool->cache()->entry_at(main_index)->f1(); |
739 oop f1_value = pool->cache()->entry_at(main_index)->f1(); |
739 methodHandle signature_invoker(THREAD, (methodOop) f1_value); |
740 methodHandle signature_invoker(THREAD, (methodOop) f1_value); |
740 assert(signature_invoker.not_null() && signature_invoker->is_method() && signature_invoker->is_method_handle_invoke(), |
741 assert(signature_invoker.not_null() && signature_invoker->is_method() && signature_invoker->is_method_handle_invoke(), |
741 "correct result from LinkResolver::resolve_invokedynamic"); |
742 "correct result from LinkResolver::resolve_invokedynamic"); |
742 |
743 |
|
744 Handle info; // optional argument(s) in JVM_CONSTANT_InvokeDynamic |
743 Handle bootm = SystemDictionary::find_bootstrap_method(caller_method, caller_bci, |
745 Handle bootm = SystemDictionary::find_bootstrap_method(caller_method, caller_bci, |
744 main_index, CHECK); |
746 main_index, info, CHECK); |
745 if (bootm.is_null()) { |
747 if (!java_dyn_MethodHandle::is_instance(bootm())) { |
746 THROW_MSG(vmSymbols::java_lang_IllegalStateException(), |
748 THROW_MSG(vmSymbols::java_lang_IllegalStateException(), |
747 "no bootstrap method found for invokedynamic"); |
749 "no bootstrap method found for invokedynamic"); |
748 } |
750 } |
749 |
751 |
750 // Short circuit if CallSite has been bound already: |
752 // Short circuit if CallSite has been bound already: |
751 if (!pool->cache()->secondary_entry_at(site_index)->is_f1_null()) |
753 if (!pool->cache()->secondary_entry_at(site_index)->is_f1_null()) |
752 return; |
754 return; |
753 |
755 |
754 symbolHandle call_site_name(THREAD, pool->name_ref_at(site_index)); |
756 symbolHandle call_site_name(THREAD, pool->name_ref_at(site_index)); |
755 |
|
756 Handle info; // NYI: Other metadata from a new kind of CP entry. (Annotations?) |
|
757 |
757 |
758 Handle call_site |
758 Handle call_site |
759 = SystemDictionary::make_dynamic_call_site(bootm, |
759 = SystemDictionary::make_dynamic_call_site(bootm, |
760 // Callee information: |
760 // Callee information: |
761 call_site_name, |
761 call_site_name, |