Clean up GetAddrOfSecurityObjectFromCachedInfo (dotnet/coreclr#9291)
authorJonghyun Park <parjong@gmail.com>
Fri, 3 Feb 2017 02:32:22 +0000 (11:32 +0900)
committerJan Kotas <jkotas@microsoft.com>
Fri, 3 Feb 2017 02:32:22 +0000 (18:32 -0800)
GetAddrOfSecurityObjectFromCachedInfo seems to be X86-specific, but has
ifdef for other architectures.

This commit declares GetAddrOfSecurityObjectFromCachedInfo only for X86
to simplify its implementation.

Commit migrated from https://github.com/dotnet/coreclr/commit/7554180ccf845804de069b2b6b3c1bab48009e26

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

index cbed0cc..8ff7658 100644 (file)
@@ -496,6 +496,7 @@ bool EnumGcRefsConservative(PREGDISPLAY     pRD,
                             LPVOID          hCallBack);
 #endif // FEATURE_CONSERVATIVE_GC
 
+#ifdef _TARGET_X86_
 /*
    Return the address of the local security object reference
    using data that was previously cached before in UnwindStackFrame
@@ -504,6 +505,7 @@ bool EnumGcRefsConservative(PREGDISPLAY     pRD,
 static OBJECTREF* GetAddrOfSecurityObjectFromCachedInfo(
         PREGDISPLAY pRD,
         StackwalkCacheUnwindInfo * stackwalkCacheUnwindInfo);
+#endif // _TARGET_X86_
 
 virtual
 OBJECTREF* GetAddrOfSecurityObject(CrawlFrame *pCF) DAC_UNEXPECTED();
index 44f42a4..eea54a8 100644 (file)
@@ -5026,6 +5026,7 @@ bool EECodeManager::EnumGcRefs( PREGDISPLAY     pContext,
 
 #endif // _TARGET_X86_
 
+#ifdef _TARGET_X86_
 /*****************************************************************************
  *
  *  Return the address of the local security object reference
@@ -5036,18 +5037,15 @@ bool EECodeManager::EnumGcRefs( PREGDISPLAY     pContext,
 OBJECTREF* EECodeManager::GetAddrOfSecurityObjectFromCachedInfo(PREGDISPLAY pRD, StackwalkCacheUnwindInfo * stackwalkCacheUnwindInfo)
 {
     LIMITED_METHOD_CONTRACT;
-#ifdef _TARGET_X86_
     size_t securityObjectOffset = stackwalkCacheUnwindInfo->securityObjectOffset;
+
     _ASSERTE(securityObjectOffset != 0);
     // We pretend that filters are ESP-based methods in UnwindEbpDoubleAlignFrame().
     // Hence we cannot enforce this assert.
     // _ASSERTE(stackwalkCacheUnwindInfo->fUseEbpAsFrameReg);
     return (OBJECTREF *) (size_t) (*pRD->GetEbpLocation() - (securityObjectOffset * sizeof(void*)));
-#else
-    PORTABILITY_ASSERT("EECodeManager::GetAddrOfSecurityObjectFromContext is not implemented on this platform.");
-    return NULL;
-#endif
 }
+#endif // _TARGET_X86_
 
 #ifndef DACCESS_COMPILE
 OBJECTREF* EECodeManager::GetAddrOfSecurityObject(CrawlFrame *pCF)