From 9fa74bc1794a50e9211d4b929975cfd0c7bbab2b Mon Sep 17 00:00:00 2001 From: Jonghyun Park Date: Thu, 9 Feb 2017 15:36:55 +0900 Subject: [PATCH] Clean up EECodeManager::GetParamContextType (dotnet/coreclr#9428) Commit migrated from https://github.com/dotnet/coreclr/commit/9c37052c23fa45e2fb228b73e1a44b08de242635 --- src/coreclr/src/vm/eetwain.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/coreclr/src/vm/eetwain.cpp b/src/coreclr/src/vm/eetwain.cpp index 46cff26..50b421e 100644 --- a/src/coreclr/src/vm/eetwain.cpp +++ b/src/coreclr/src/vm/eetwain.cpp @@ -5260,7 +5260,7 @@ GenericParamContextType EECodeManager::GetParamContextType(PREGDISPLAY pCont { LIMITED_METHOD_DAC_CONTRACT; -#ifdef _TARGET_X86_ +#ifndef USE_GC_INFO_DECODER /* Extract the necessary information from the info block header */ GCInfoToken gcInfoToken = pCodeInfo->GetGCInfoToken(); PTR_VOID methodInfoPtr = pCodeInfo->GetGCInfo(); @@ -5278,16 +5278,16 @@ GenericParamContextType EECodeManager::GetParamContextType(PREGDISPLAY pCont { return GENERIC_PARAM_CONTEXT_NONE; } - else if (info.genericsContextIsMethodDesc) + + if (info.genericsContextIsMethodDesc) { return GENERIC_PARAM_CONTEXT_METHODDESC; } - else - { - return GENERIC_PARAM_CONTEXT_METHODTABLE; - } + + return GENERIC_PARAM_CONTEXT_METHODTABLE; + // On x86 the generic param context parameter is never this. -#elif defined(USE_GC_INFO_DECODER) +#else // !USE_GC_INFO_DECODER GCInfoToken gcInfoToken = pCodeInfo->GetGCInfoToken(); GcInfoDecoder gcInfoDecoder( @@ -5309,10 +5309,7 @@ GenericParamContextType EECodeManager::GetParamContextType(PREGDISPLAY pCont return GENERIC_PARAM_CONTEXT_THIS; } return GENERIC_PARAM_CONTEXT_NONE; -#else // !_TARGET_X86_ && !USE_GC_INFO_DECODER - PORTABILITY_ASSERT("Port: EECodeManager::GetParamContextType is not implemented on this platform."); - return GENERIC_PARAM_CONTEXT_NONE; -#endif // _TARGET_X86_ +#endif // USE_GC_INFO_DECODER } #ifndef CROSSGEN_COMPILE -- 2.7.4