src/hotspot/share/interpreter/interpreterRuntime.cpp
changeset 53994 77343f5c85cb
parent 53971 1019c97e1bde
child 54523 5df03f58d25b
equal deleted inserted replaced
53993:271f75d4b494 53994:77343f5c85cb
   918   } else {
   918   } else {
   919     assert(info.call_kind() == CallInfo::direct_call ||
   919     assert(info.call_kind() == CallInfo::direct_call ||
   920            info.call_kind() == CallInfo::vtable_call, "");
   920            info.call_kind() == CallInfo::vtable_call, "");
   921   }
   921   }
   922 #endif
   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 
   923 
   929   switch (info.call_kind()) {
   924   switch (info.call_kind()) {
   930   case CallInfo::direct_call:
   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 
   931     cp_cache_entry->set_direct_call(
   933     cp_cache_entry->set_direct_call(
   932       bytecode,
   934       bytecode,
   933       info.resolved_method(),
   935       info.resolved_method(),
   934       sender->is_interface());
   936       sender->is_interface(),
       
   937       pool_holder);
   935     break;
   938     break;
       
   939   }
   936   case CallInfo::vtable_call:
   940   case CallInfo::vtable_call:
   937     cp_cache_entry->set_vtable_call(
   941     cp_cache_entry->set_vtable_call(
   938       bytecode,
   942       bytecode,
   939       info.resolved_method(),
   943       info.resolved_method(),
   940       info.vtable_index());
   944       info.vtable_index());