Fix Linux x86 build (#34548)
authorGleb Balykov <g.balykov@samsung.com>
Mon, 6 Apr 2020 15:40:10 +0000 (18:40 +0300)
committerGitHub <noreply@github.com>
Mon, 6 Apr 2020 15:40:10 +0000 (08:40 -0700)
* Fix Linux x86 build

Related to #33005

* Fix Linux x86 build

Related to #33653, #33005

* Fix Linux x86 build

Related to #32250

src/coreclr/src/vm/comdelegate.cpp
src/coreclr/src/vm/comdelegate.h
src/coreclr/src/vm/exceptionhandling.cpp
src/coreclr/src/vm/i386/asmhelpers.S
src/coreclr/src/vm/prestub.cpp

index ac3c4d0..958a220 100644 (file)
@@ -1132,7 +1132,7 @@ void COMDelegate::BindToMethod(DELEGATEREF   *pRefThis,
     GCPROTECT_END();
 }
 
-#if defined(TARGET_X86) && defined(TARGET_WINDOWS)
+#if defined(TARGET_X86)
 // Marshals a managed method to an unmanaged callback provided the
 // managed method is static and it's parameters require no marshalling.
 PCODE COMDelegate::ConvertToCallback(MethodDesc* pMD)
@@ -1189,7 +1189,7 @@ PCODE COMDelegate::ConvertToCallback(MethodDesc* pMD)
     _ASSERTE(pCode != NULL);
     return pCode;
 }
-#endif // defined(TARGET_X86) && defined(TARGET_WINDOWS)
+#endif // defined(TARGET_X86)
 
 // Marshals a delegate to a unmanaged callback.
 LPVOID COMDelegate::ConvertToCallback(OBJECTREF pDelegateObj)
index a87845d..d11d79f 100644 (file)
@@ -84,11 +84,11 @@ public:
     // Marshals a delegate to a unmanaged callback.
     static LPVOID ConvertToCallback(OBJECTREF pDelegate);
 
-#if defined(TARGET_X86) && defined(TARGET_WINDOWS)
+#if defined(TARGET_X86)
     // Marshals a managed method to an unmanaged callback.
-    // This is only used on x86 Windows. See usage for further details.
+    // This is only used on x86. See usage for further details.
     static PCODE ConvertToCallback(MethodDesc* pMD);
-#endif // defined(TARGET_X86) && defined(TARGET_WINDOWS)
+#endif // defined(TARGET_X86)
 
     // Marshals an unmanaged callback to Delegate
     static OBJECTREF ConvertToDelegate(LPVOID pCallback, MethodTable* pMT);
index cd33b0f..bdf1bda 100644 (file)
@@ -1257,6 +1257,7 @@ lExit: ;
 
     if ((ExceptionContinueSearch == returnDisposition))
     {
+#ifdef USE_GC_INFO_DECODER
         if (dwExceptionFlags & EXCEPTION_UNWINDING)
         {
             EECodeInfo codeInfo(pDispatcherContext->ControlPc);
@@ -1272,6 +1273,7 @@ lExit: ;
                 }
             }
         }
+#endif // USE_GC_INFO_DECODER
 
         GCX_PREEMP_NO_DTOR();
     }
@@ -4663,6 +4665,7 @@ VOID DECLSPEC_NORETURN UnwindManagedExceptionPass1(PAL_SEHException& ex, CONTEXT
             controlPc = Thread::VirtualUnwindLeafCallFrame(frameContext);
         }
 
+#ifdef USE_GC_INFO_DECODER
         GcInfoDecoder gcInfoDecoder(codeInfo.GetGCInfoToken(), DECODE_REVERSE_PINVOKE_VAR);
 
         if (gcInfoDecoder.GetReversePInvokeFrameStackSlot() != NO_REVERSE_PINVOKE_FRAME)
@@ -4676,6 +4679,7 @@ VOID DECLSPEC_NORETURN UnwindManagedExceptionPass1(PAL_SEHException& ex, CONTEXT
             TerminateProcess(GetCurrentProcess(), 1);
             UNREACHABLE();
         }
+#endif // USE_GC_INFO_DECODER
 
         // Check whether we are crossing managed-to-native boundary
         while (!ExecutionManager::IsManagedCode(controlPc))
index c318dc3..7ed9d6b 100644 (file)
@@ -1401,7 +1401,7 @@ NESTED_ENTRY OnCallCountThresholdReachedStub2, _TEXT, NoHandler
 
     // Align the stack for the call
     lea     ebx, [esp - 8]
-    and     ebx, 0fh
+    and     ebx, 0x0f
     sub     esp, ebx
 
     push    eax // stub-identifying token, see OnCallCountThresholdReachedStub
index e75bc9f..cd25aaa 100644 (file)
@@ -439,7 +439,7 @@ PCODE MethodDesc::GetPrecompiledCode(PrepareCodeConfig* pConfig)
 
 #ifdef FEATURE_TIERED_COMPILATION
             bool shouldTier = pConfig->GetMethodDesc()->IsEligibleForTieredCompilation();
-#if !defined(TARGET_X86) || !defined(TARGET_WINDOWS)
+#if !defined(TARGET_X86)
             CallerGCMode callerGcMode = pConfig->GetCallerGCMode();
             // If the method is eligible for tiering but is being
             // called from a Preemptive GC Mode thread or the method
@@ -458,7 +458,7 @@ PCODE MethodDesc::GetPrecompiledCode(PrepareCodeConfig* pConfig)
                 codeVersion.SetOptimizationTier(NativeCodeVersion::OptimizationTierOptimized);
                 shouldTier = false;
             }
-#endif  // !TARGET_X86 || !TARGET_WINDOWS
+#endif  // !TARGET_X86
 #endif // FEATURE_TIERED_COMPILATION
 
             if (pConfig->SetNativeCode(pCode, &pCode))