@@ -2000,13 +2000,9 @@ PCODE MethodDesc::GetSingleCallableAddrOfVirtualizedCode(OBJECTREF *orThis, Type
20002000 return pObjMT->GetRestoredSlot (GetSlot ());
20012001}
20022002
2003- // *******************************************************************************
2004- // The following resolve virtual dispatch for the given method on the given
2005- // object down to an actual address to call, including any
2006- // handling of context proxies and other thunking layers.
2007- PCODE MethodDesc::GetMultiCallableAddrOfVirtualizedCode (OBJECTREF *orThis, TypeHandle staticTH)
2003+ MethodDesc* MethodDesc::GetMethodDescOfVirtualizedCode (OBJECTREF *orThis, TypeHandle staticTH)
20082004{
2009- CONTRACT (PCODE )
2005+ CONTRACT (MethodDesc* )
20102006 {
20112007 THROWS;
20122008 GC_TRIGGERS;
@@ -2016,41 +2012,43 @@ PCODE MethodDesc::GetMultiCallableAddrOfVirtualizedCode(OBJECTREF *orThis, TypeH
20162012 POSTCONDITION (RETVAL != NULL );
20172013 }
20182014 CONTRACT_END;
2019-
20202015 // Method table of target (might be instantiated)
20212016 MethodTable *pObjMT = (*orThis)->GetMethodTable ();
20222017
20232018 // This is the static method descriptor describing the call.
20242019 // It is not the destination of the call, which we must compute.
20252020 MethodDesc* pStaticMD = this ;
2026- MethodDesc *pTargetMD;
20272021
20282022 if (pStaticMD->HasMethodInstantiation ())
20292023 {
20302024 CheckRestore ();
2031- pTargetMD = ResolveGenericVirtualMethod (orThis);
2032-
2033- // If we're remoting this call we can't call directly on the returned
2034- // method desc, we need to go through a stub that guarantees we end up
2035- // in the remoting handler. The stub we use below is normally just for
2036- // non-virtual calls on virtual methods (that have the same problem
2037- // where we could end up bypassing the remoting system), but it serves
2038- // our purpose here (basically pushes our correctly instantiated,
2039- // resolved method desc on the stack and calls the remoting code).
2040-
2041- RETURN (pTargetMD->GetMultiCallableAddrOfCode ());
2025+ RETURN (ResolveGenericVirtualMethod (orThis));
20422026 }
20432027
20442028 if (pStaticMD->IsInterface ())
20452029 {
2046- pTargetMD = MethodTable::GetMethodDescForInterfaceMethodAndServer (staticTH,pStaticMD,orThis);
2047- RETURN (pTargetMD->GetMultiCallableAddrOfCode ());
2030+ RETURN (MethodTable::GetMethodDescForInterfaceMethodAndServer (staticTH, pStaticMD, orThis));
20482031 }
20492032
2033+ RETURN (pObjMT->GetMethodDescForSlot (pStaticMD->GetSlot ()));
2034+ }
20502035
2051- pTargetMD = pObjMT->GetMethodDescForSlot (pStaticMD->GetSlot ());
2036+ // *******************************************************************************
2037+ // The following resolve virtual dispatch for the given method on the given
2038+ // object down to an actual address to call, including any
2039+ // handling of context proxies and other thunking layers.
2040+ PCODE MethodDesc::GetMultiCallableAddrOfVirtualizedCode (OBJECTREF *orThis, TypeHandle staticTH)
2041+ {
2042+ CONTRACT (PCODE)
2043+ {
2044+ THROWS;
2045+ GC_TRIGGERS;
2046+ POSTCONDITION (RETVAL != NULL );
2047+ }
2048+ CONTRACT_END;
20522049
2053- RETURN (pTargetMD->GetMultiCallableAddrOfCode ());
2050+ MethodDesc *pTargetMD = GetMethodDescOfVirtualizedCode (orThis, staticTH);
2051+ RETURN (pTargetMD->GetMultiCallableAddrOfCode ());
20542052}
20552053
20562054// *******************************************************************************
0 commit comments