903 info.call_kind() == CallInfo::direct_call, ""); 904 methodHandle rm = info.resolved_method(); 905 assert(rm->is_final() || info.has_vtable_index(), 906 "should have been set already"); 907 } else if (!info.resolved_method()->has_itable_index()) { 908 // Resolved something like CharSequence.toString. Use vtable not itable. 909 assert(info.call_kind() != CallInfo::itable_call, ""); 910 } else { 911 // Setup itable entry 912 assert(info.call_kind() == CallInfo::itable_call, ""); 913 int index = info.resolved_method()->itable_index(); 914 assert(info.itable_index() == index, ""); 915 } 916 } else if (bytecode == Bytecodes::_invokespecial) { 917 assert(info.call_kind() == CallInfo::direct_call, "must be direct call"); 918 } else { 919 assert(info.call_kind() == CallInfo::direct_call || 920 info.call_kind() == CallInfo::vtable_call, ""); 921 } 922 #endif 923 924 switch (info.call_kind()) { 925 case CallInfo::direct_call: { 926 // Get sender or sender's unsafe_anonymous_host, and only set cpCache entry to resolved if 927 // it is not an interface. The receiver for invokespecial calls within interface 928 // methods must be checked for every call. 929 InstanceKlass* pool_holder = pool->pool_holder(); 930 InstanceKlass* sender = pool_holder->is_unsafe_anonymous() ? 931 pool_holder->unsafe_anonymous_host() : pool_holder; 932 933 cp_cache_entry->set_direct_call( 934 bytecode, 935 info.resolved_method(), 936 sender->is_interface(), 937 pool_holder); 938 break; 939 } 940 case CallInfo::vtable_call: 941 cp_cache_entry->set_vtable_call( 942 bytecode, 943 info.resolved_method(), 944 info.vtable_index()); 945 break; 946 case CallInfo::itable_call: 947 cp_cache_entry->set_itable_call( 948 bytecode, 949 info.resolved_klass(), 950 info.resolved_method(), 951 info.itable_index()); 952 break; 953 default: ShouldNotReachHere(); 954 } 955 } 956 957 958 // First time execution: Resolve symbols, create a permanent MethodType object. 959 void InterpreterRuntime::resolve_invokehandle(JavaThread* thread) { | 903 info.call_kind() == CallInfo::direct_call, ""); 904 methodHandle rm = info.resolved_method(); 905 assert(rm->is_final() || info.has_vtable_index(), 906 "should have been set already"); 907 } else if (!info.resolved_method()->has_itable_index()) { 908 // Resolved something like CharSequence.toString. Use vtable not itable. 909 assert(info.call_kind() != CallInfo::itable_call, ""); 910 } else { 911 // Setup itable entry 912 assert(info.call_kind() == CallInfo::itable_call, ""); 913 int index = info.resolved_method()->itable_index(); 914 assert(info.itable_index() == index, ""); 915 } 916 } else if (bytecode == Bytecodes::_invokespecial) { 917 assert(info.call_kind() == CallInfo::direct_call, "must be direct call"); 918 } else { 919 assert(info.call_kind() == CallInfo::direct_call || 920 info.call_kind() == CallInfo::vtable_call, ""); 921 } 922 #endif 923 // Get sender or sender's unsafe_anonymous_host, and only set cpCache entry to resolved if 924 // it is not an interface. The receiver for invokespecial calls within interface 925 // methods must be checked for every call. 926 InstanceKlass* sender = pool->pool_holder(); 927 sender = sender->is_unsafe_anonymous() ? sender->unsafe_anonymous_host() : sender; 928 929 switch (info.call_kind()) { 930 case CallInfo::direct_call: 931 cp_cache_entry->set_direct_call( 932 bytecode, 933 info.resolved_method(), 934 sender->is_interface()); 935 break; 936 case CallInfo::vtable_call: 937 cp_cache_entry->set_vtable_call( 938 bytecode, 939 info.resolved_method(), 940 info.vtable_index()); 941 break; 942 case CallInfo::itable_call: 943 cp_cache_entry->set_itable_call( 944 bytecode, 945 info.resolved_klass(), 946 info.resolved_method(), 947 info.itable_index()); 948 break; 949 default: ShouldNotReachHere(); 950 } 951 } 952 953 954 // First time execution: Resolve symbols, create a permanent MethodType object. 955 void InterpreterRuntime::resolve_invokehandle(JavaThread* thread) { |