Clean up EECodeManager::GetInstance (dotnet/coreclr#9424)
authorJonghyun Park <parjong@gmail.com>
Thu, 9 Feb 2017 06:38:12 +0000 (15:38 +0900)
committerJan Kotas <jkotas@microsoft.com>
Thu, 9 Feb 2017 06:38:12 +0000 (22:38 -0800)
* Clean up EECodeManager::GetInstance

* Use !CROSSGEN_COMPILE instead of CROSSGEN_COMPILE

Commit migrated from https://github.com/dotnet/coreclr/commit/1002e0fc483430933b7f7e561b4a3bd7702249d8

src/coreclr/src/inc/eetwain.h
src/coreclr/src/vm/eetwain.cpp

index 87d2b41..c89952b 100644 (file)
@@ -251,6 +251,7 @@ virtual bool EnumGcRefs(PREGDISPLAY     pContext,
 */
 virtual OBJECTREF* GetAddrOfSecurityObject(CrawlFrame *pCF) = 0;
 
+#ifndef CROSSGEN_COMPILE
 /*
     For a non-static method, "this" pointer is passed in as argument 0.
     However, if there is a "ldarga 0" or "starg 0" in the IL, 
@@ -263,6 +264,7 @@ virtual OBJECTREF* GetAddrOfSecurityObject(CrawlFrame *pCF) = 0;
 */
 virtual OBJECTREF GetInstance(PREGDISPLAY     pContext,
                               EECodeInfo*     pCodeInfo) = 0;
+#endif // !CROSSGEN_COMPILE
 
 #ifndef CROSSGEN_COMPILE
 /*
@@ -523,10 +525,12 @@ static OBJECTREF* GetAddrOfSecurityObjectFromCachedInfo(
 virtual
 OBJECTREF* GetAddrOfSecurityObject(CrawlFrame *pCF) DAC_UNEXPECTED();
 
+#ifndef CROSSGEN_COMPILE
 virtual
 OBJECTREF GetInstance(
                 PREGDISPLAY     pContext,
                 EECodeInfo *    pCodeInfo);
+#endif // !CROSSGEN_COMPILE
 
 #ifndef CROSSGEN_COMPILE
 /*
index 94a1ece..2624f4c 100644 (file)
@@ -5113,6 +5113,7 @@ OBJECTREF* EECodeManager::GetAddrOfSecurityObject(CrawlFrame *pCF)
 }
 #endif
 
+#ifndef CROSSGEN_COMPILE
 /*****************************************************************************
  *
  *  Returns "this" pointer if it is a non-static method
@@ -5134,7 +5135,7 @@ OBJECTREF EECodeManager::GetInstance( PREGDISPLAY    pContext,
         SUPPORTS_DAC;
     } CONTRACTL_END;
 
-#ifdef _TARGET_X86_
+#ifndef USE_GC_INFO_DECODER
     GCInfoToken gcInfoToken = pCodeInfo->GetGCInfoToken();
     unsigned    relOffset = pCodeInfo->GetRelOffset();
 
@@ -5242,18 +5243,15 @@ OBJECTREF EECodeManager::GetInstance( PREGDISPLAY    pContext,
 #endif
 
     return NULL;
-#elif defined(USE_GC_INFO_DECODER) && !defined(CROSSGEN_COMPILE)
+#else // !USE_GC_INFO_DECODER
     PTR_VOID token = EECodeManager::GetExactGenericsToken(pContext, pCodeInfo);
 
     OBJECTREF oRef = ObjectToOBJECTREF(PTR_Object(dac_cast<TADDR>(token)));
     VALIDATEOBJECTREF(oRef);
     return oRef;
-#else // !_TARGET_X86_ && !(USE_GC_INFO_DECODER && !CROSSGEN_COMPILE)
-    PORTABILITY_ASSERT("Port: EECodeManager::GetInstance is not implemented on this platform.");
-    return NULL;
-#endif // _TARGET_X86_
+#endif // USE_GC_INFO_DECODER
 }
-
+#endif // !CROSSGEN_COMPILE
 
 GenericParamContextType EECodeManager::GetParamContextType(PREGDISPLAY     pContext,
                                                            EECodeInfo *    pCodeInfo)