From: Jonghyun Park Date: Thu, 9 Feb 2017 06:38:12 +0000 (+0900) Subject: Clean up EECodeManager::GetInstance (dotnet/coreclr#9424) X-Git-Tag: submit/tizen/20210909.063632~11030^2~8149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c5effbba71793f4445374123369d299c8d04e475;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Clean up EECodeManager::GetInstance (dotnet/coreclr#9424) * Clean up EECodeManager::GetInstance * Use !CROSSGEN_COMPILE instead of CROSSGEN_COMPILE Commit migrated from https://github.com/dotnet/coreclr/commit/1002e0fc483430933b7f7e561b4a3bd7702249d8 --- diff --git a/src/coreclr/src/inc/eetwain.h b/src/coreclr/src/inc/eetwain.h index 87d2b41..c89952b 100644 --- a/src/coreclr/src/inc/eetwain.h +++ b/src/coreclr/src/inc/eetwain.h @@ -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 /* diff --git a/src/coreclr/src/vm/eetwain.cpp b/src/coreclr/src/vm/eetwain.cpp index 94a1ece..2624f4c 100644 --- a/src/coreclr/src/vm/eetwain.cpp +++ b/src/coreclr/src/vm/eetwain.cpp @@ -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(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)