CLRUnwindStatus status;
+#ifdef USE_PER_FRAME_PINVOKE_INIT
// Refer to comment in ProcessOSExceptionNotification about ICF and codegen difference.
- ARM_ONLY(InlinedCallFrame *pICFSetAsLimitFrame = NULL;)
-
+ InlinedCallFrame *pICFSetAsLimitFrame = NULL;
+#endif // USE_PER_FRAME_PINVOKE_INIT
+
status = pTracker->ProcessOSExceptionNotification(
pExceptionRecord,
pContextRecord,
dwExceptionFlags,
sf,
pThread,
- STState ARM_ARG((PVOID)pICFSetAsLimitFrame));
+ STState
+#ifdef USE_PER_FRAME_PINVOKE_INIT
+ , (PVOID)pICFSetAsLimitFrame
+#endif // USE_PER_FRAME_PINVOKE_INIT
+ );
if (FirstPassComplete == status)
{
CONSISTENCY_CHECK(pLimitFrame > dac_cast<PTR_VOID>(GetSP(pContextRecord)));
-#if defined(_TARGET_ARM_)
+#ifdef USE_PER_FRAME_PINVOKE_INIT
if (pICFSetAsLimitFrame != NULL)
{
_ASSERTE(pICFSetAsLimitFrame == pLimitFrame);
// the next pinvoke callsite does not see the frame as active.
pICFSetAsLimitFrame->Reset();
}
-#endif // defined(_TARGET_ARM_)
+#endif // USE_PER_FRAME_PINVOKE_INIT
pThread->SetFrame(pLimitFrame);
DWORD dwExceptionFlags,
StackFrame sf,
Thread* pThread,
- StackTraceState STState ARM_ARG(PVOID pICFSetAsLimitFrame))
+ StackTraceState STState
+#ifdef USE_PER_FRAME_PINVOKE_INIT
+ , PVOID pICFSetAsLimitFrame
+#endif // USE_PER_FRAME_PINVOKE_INIT
+)
{
CONTRACTL
{
this->m_EnclosingClauseInfoForGCReporting.SetEnclosingClauseCallerSP(uCallerSP);
}
-#if defined(_TARGET_ARM_)
+#ifdef USE_PER_FRAME_PINVOKE_INIT
// Refer to detailed comment below.
PTR_Frame pICFForUnwindTarget = NULL;
-#endif // defined(_TARGET_ARM_)
+#endif // USE_PER_FRAME_PINVOKE_INIT
CheckForRudeAbort(pThread, fIsFirstPass);
while (((UINT_PTR)pFrame) < uCallerSP)
{
-#if defined(_TARGET_ARM_)
+#ifdef USE_PER_FRAME_PINVOKE_INIT
// InlinedCallFrames (ICF) are allocated, initialized and linked to the Frame chain
// by the code generated by the JIT for a method containing a PInvoke.
//
if (fTargetUnwind && (status == SecondPassComplete))
{
-#if defined(_TARGET_ARM_)
+#ifdef USE_PER_FRAME_PINVOKE_INIT
// If we have got a ICF to set as the LimitFrame, do that now.
// The Frame chain is still intact and would be updated using
// the LimitFrame (done after the catch handler returns).
m_pLimitFrame = pICFForUnwindTarget;
pICFSetAsLimitFrame = (PVOID)pICFForUnwindTarget;
}
-#endif // _TARGET_ARM_
+#endif // USE_PER_FRAME_PINVOKE_INIT
// Since second pass is complete and we have reached
// the frame containing the catch funclet, reset the enclosing
#ifdef WIN64EXCEPTIONS
+#if defined(_TARGET_ARM_) || defined(_TARGET_X86_)
+#define USE_PER_FRAME_PINVOKE_INIT
+#endif // _TARGET_ARM_ || _TARGET_X86_
+
+
// This address lies in the NULL pointer partition of the process memory.
// Accessing it will result in AV.
#define INVALID_RESUME_ADDRESS 0x000000000000bad0
DWORD dwExceptionFlags,
StackFrame sf,
Thread* pThread,
- StackTraceState STState ARM_ARG(PVOID pICFSetAsLimitFrame));
+ StackTraceState STState
+#ifdef USE_PER_FRAME_PINVOKE_INIT
+ , PVOID pICFSetAsLimitFrame
+#endif // USE_PER_FRAME_PINVOKE_INIT
+ );
CLRUnwindStatus ProcessExplicitFrame(
CrawlFrame* pcfThisFrame,