@@ -1234,9 +1234,9 @@ COR_ILMETHOD* MethodDesc::GetILHeader()
12341234#endif  //  !DACCESS_COMPILE
12351235}
12361236
1237- #if  defined(TARGET_X86) ||  defined(FEATURE_COMINTEROP )
1237+ #if  defined(TARGET_X86) &&  defined(HAVE_GCCOVER )
12381238// *******************************************************************************
1239- ReturnKind MethodDesc::GetReturnKind (INDEBUG ( bool  supportStringConstructors) )
1239+ ReturnKind MethodDesc::GetReturnKind ()
12401240{
12411241    CONTRACTL
12421242    {
@@ -1263,15 +1263,13 @@ ReturnKind MethodDesc::GetReturnKind(INDEBUG(bool supportStringConstructors))
12631263
12641264    switch  (et)
12651265    {
1266- #ifdef  TARGET_X86
12671266        case  ELEMENT_TYPE_R4:
12681267        case  ELEMENT_TYPE_R8:
12691268            //  Figuring out whether the function returns FP or not is hard to do
12701269            //  on-the-fly, so we use a different callback helper on x86 where this
12711270            //  piece of information is needed in order to perform the right save &
12721271            //  restore of the return value around the call to OnHijackScalarWorker.
12731272            return  RT_Float;
1274- #endif 
12751273
12761274        case  ELEMENT_TYPE_STRING:
12771275        case  ELEMENT_TYPE_CLASS:
@@ -1281,7 +1279,6 @@ ReturnKind MethodDesc::GetReturnKind(INDEBUG(bool supportStringConstructors))
12811279        case  ELEMENT_TYPE_VAR:
12821280            return  RT_Object;
12831281
1284- #ifdef  ENREGISTERED_RETURNTYPE_INTEGER_MAXSIZE
12851282        case  ELEMENT_TYPE_VALUETYPE:
12861283            //  We return value types in registers if they fit in ENREGISTERED_RETURNTYPE_MAXSIZE
12871284            //  These valuetypes could contain gc refs.
@@ -1294,40 +1291,29 @@ ReturnKind MethodDesc::GetReturnKind(INDEBUG(bool supportStringConstructors))
12941291                    if  (!thValueType.IsTypeDesc ())
12951292                    {
12961293                        MethodTable * pReturnTypeMT = thValueType.AsMethodTable ();
1294+                         if  (pReturnTypeMT->ContainsGCPointers ())
1295+                         {
1296+                             _ASSERTE (pReturnTypeMT->GetNumInstanceFieldBytes () == sizeof (void *));
1297+                             return  RT_Object;
1298+                         }
12971299
1298-                         if  (pReturnTypeMT->ContainsGCPointers () || pReturnTypeMT-> IsByRefLike ())
1300+                         if  (pReturnTypeMT->IsByRefLike ())
12991301                        {
1300-                             if  (pReturnTypeMT->GetNumInstanceFields () == 1 )
1301-                             {
1302-                                 _ASSERTE (pReturnTypeMT->GetNumInstanceFieldBytes () == sizeof (void *));
1303-                                 //  Note: we can't distinguish RT_Object from RT_ByRef, the caller has to tolerate that.
1304-                                 return  RT_Object;
1305-                             }
1306-                             else 
1307-                             {
1308-                                 //  Multi reg return case with pointers, can't restore the actual kind.
1309-                                 return  RT_Illegal;
1310-                             }
1302+                             //  This would require going through all fields
1303+                             return  RT_Illegal;
13111304                        }
13121305                    }
13131306                }
13141307            }
13151308            break ;
1316- #endif  //  ENREGISTERED_RETURNTYPE_INTEGER_MAXSIZE
13171309
1318- #ifdef  _DEBUG
13191310        case  ELEMENT_TYPE_VOID:
1320-             //  String constructors return objects.  We should not have any ecall string
1321-             //  constructors, except when called from gc coverage codes (which is only
1322-             //  done under debug).  We will therefore optimize the retail version of this
1323-             //  method to not support string constructors.
1311+             //  String constructors return objects..
13241312            if  (IsCtor () && GetMethodTable ()->HasComponentSize ())
13251313            {
1326-                 _ASSERTE (supportStringConstructors);
13271314                return  RT_Object;
13281315            }
13291316            break ;
1330- #endif  //  _DEBUG
13311317
13321318        case  ELEMENT_TYPE_BYREF:
13331319            return  RT_ByRef;
@@ -1338,7 +1324,7 @@ ReturnKind MethodDesc::GetReturnKind(INDEBUG(bool supportStringConstructors))
13381324
13391325    return  RT_Scalar;
13401326}
1341- #endif  //  TARGET_X86 || FEATURE_COMINTEROP 
1327+ #endif  //  TARGET_X86 && HAVE_GCCOVER 
13421328
13431329#ifdef  FEATURE_COMINTEROP
13441330
0 commit comments