Simplify #ifdef related with UnwindStackFrame (dotnet/coreclr#9052)
authorJonghyun Park <parjong@gmail.com>
Tue, 24 Jan 2017 11:09:16 +0000 (20:09 +0900)
committerJan Vorlicek <janvorli@microsoft.com>
Tue, 24 Jan 2017 11:09:16 +0000 (12:09 +0100)
Commit migrated from https://github.com/dotnet/coreclr/commit/69e3c50ee80a16fd4d2c287422ed7c4d1056b667

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

index 49ea207..5b88be3 100644 (file)
@@ -192,6 +192,7 @@ virtual TADDR GetAmbientSP(PREGDISPLAY     pContext,
 */
 virtual ULONG32 GetStackParameterSize(EECodeInfo* pCodeInfo) = 0;
 
+#ifndef CROSSGEN_COMPILE
 /*
     Unwind the current stack frame, i.e. update the virtual register
     set in pContext. This will be similar to the state after the function
@@ -205,6 +206,7 @@ virtual bool UnwindStackFrame(PREGDISPLAY     pContext,
                               unsigned        flags,
                               CodeManState   *pState,
                               StackwalkCacheUnwindInfo  *pUnwindInfo) = 0;
+#endif // CROSSGEN_COMPILE
 
 /*
     Is the function currently at a "GC safe point" ?
@@ -410,6 +412,7 @@ TADDR GetAmbientSP(PREGDISPLAY     pContext,
 virtual 
 ULONG32 GetStackParameterSize(EECodeInfo* pCodeInfo);
 
+#ifndef CROSSGEN_COMPILE
 /*
     Unwind the current stack frame, i.e. update the virtual register
     set in pContext. This will be similar to the state after the function
@@ -425,6 +428,7 @@ bool UnwindStackFrame(
                 unsigned        flags,
                 CodeManState   *pState,
                 StackwalkCacheUnwindInfo  *pUnwindInfo);
+#endif // CROSSGEN_COMPILE
 
 enum QuickUnwindFlag
 {
index de65605..8bbe213 100644 (file)
@@ -3982,7 +3982,8 @@ bool UnwindStackFrame(PREGDISPLAY     pContext,
 
 #endif // _TARGET_X86_
 
-#if defined(_TARGET_X86_) && !defined(WIN64EXCEPTIONS)
+#ifndef CROSSGEN_COMPILE
+#ifndef WIN64EXCEPTIONS
 
 /*****************************************************************************
  *
@@ -4000,11 +4001,16 @@ bool EECodeManager::UnwindStackFrame(PREGDISPLAY     pContext,
                                      CodeManState   *pState,
                                      StackwalkCacheUnwindInfo  *pUnwindInfo /* out-only, perf improvement */)
 {
+#ifdef _TARGET_X86_
     return ::UnwindStackFrame(pContext, pCodeInfo, flags, pState, pUnwindInfo);
+#else // _TARGET_X86_
+    PORTABILITY_ASSERT("EECodeManager::UnwindStackFrame");
+    return false;
+#endif // _TARGET_???_
 }
 
 /*****************************************************************************/
-#elif !defined(CROSSGEN_COMPILE) // _TARGET_X86_ - UnwindStackFrame
+#else // !WIN64EXCEPTIONS
 /*****************************************************************************/
 
 bool EECodeManager::UnwindStackFrame(PREGDISPLAY     pContext,
@@ -4034,19 +4040,9 @@ bool EECodeManager::UnwindStackFrame(PREGDISPLAY     pContext,
 }
 
 /*****************************************************************************/
-#else // _TARGET_X86_ - UnwindStackFrame
-
-bool EECodeManager::UnwindStackFrame(PREGDISPLAY     pContext,
-                                     EECodeInfo     *pCodeInfo,
-                                     unsigned        flags,
-                                     CodeManState   *pState,
-                                     StackwalkCacheUnwindInfo  *pUnwindInfo /* out-only, perf improvement */)
-{
-    _ASSERTE(!"EECodeManager::UnwindStackFrame not supported in this build configuration");
-    return true;
-}
+#endif // WIN64EXCEPTIONS
+#endif // !CROSSGEN_COMPILE
 
-#endif // _TARGET_X86_ - UnwindStackFrame
 /*****************************************************************************/
 
 /* report args in 'msig' to the GC.