Skip to content

Commit

Permalink
Fix Linux x86 build (#34548)
Browse files Browse the repository at this point in the history
* Fix Linux x86 build

Related to #33005

* Fix Linux x86 build

Related to #33653, #33005

* Fix Linux x86 build

Related to #32250
  • Loading branch information
gbalykov committed Apr 6, 2020
1 parent 3e0b19f commit 9a58ab8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/coreclr/src/vm/comdelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/src/vm/comdelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ class COMDelegate
// 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);
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/src/vm/exceptionhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,7 @@ lExit: ;

if ((ExceptionContinueSearch == returnDisposition))
{
#ifdef USE_GC_INFO_DECODER
if (dwExceptionFlags & EXCEPTION_UNWINDING)
{
EECodeInfo codeInfo(pDispatcherContext->ControlPc);
Expand All @@ -1272,6 +1273,7 @@ lExit: ;
}
}
}
#endif // USE_GC_INFO_DECODER

GCX_PREEMP_NO_DTOR();
}
Expand Down Expand Up @@ -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)
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/vm/i386/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/src/vm/prestub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit 9a58ab8

Please sign in to comment.