diff options
Diffstat (limited to 'src/vm/threadsuspend.cpp')
-rw-r--r-- | src/vm/threadsuspend.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/vm/threadsuspend.cpp b/src/vm/threadsuspend.cpp index 2e6563da1e..cdfbd79497 100644 --- a/src/vm/threadsuspend.cpp +++ b/src/vm/threadsuspend.cpp @@ -816,7 +816,7 @@ static StackWalkAction TAStackCrawlCallBackWorker(CrawlFrame* pCf, StackCrawlCon EE_ILEXCEPTION_CLAUSE EHClause; StackWalkAction action = SWA_CONTINUE; -#ifdef _TARGET_X86_ +#ifndef WIN64EXCEPTIONS // On X86, the EH encoding for catch clause is completely mess. // If catch clause is in its own basic block, the end of catch includes everything in the basic block. // For nested catch, the end of catch may include several jmp instructions after JIT_EndCatch call. @@ -830,7 +830,7 @@ static StackWalkAction TAStackCrawlCallBackWorker(CrawlFrame* pCf, StackCrawlCon fAtJitEndCatch = TRUE; offs -= 1; } -#endif // _TARGET_X86_ +#endif // !WIN64EXCEPTIONS #if _TARGET_AMD64_ STRESS_LOG1(LF_EH, LL_INFO10, "AMD64 - in TAStackCrawlCallBack 0x%x offset\n", offs); @@ -898,7 +898,7 @@ static StackWalkAction TAStackCrawlCallBackWorker(CrawlFrame* pCf, StackCrawlCon if (offs >= EHClause.HandlerStartPC && offs < EHClause.HandlerEndPC) { -#ifdef _TARGET_X86_ +#ifndef WIN64EXCEPTIONS if (fAtJitEndCatch) { // On X86, JIT's EH info may include the instruction after JIT_EndCatch inside the same catch @@ -911,7 +911,7 @@ static StackWalkAction TAStackCrawlCallBackWorker(CrawlFrame* pCf, StackCrawlCon continue; } } -#endif +#endif // !WIN64EXCEPTIONS pData->fWithinEHClause = true; // We're within an EH clause. If we're asking about CERs too then stop the stack walk if we've reached a conclusive // result or continue looking otherwise. Else we can stop the stackwalk now. @@ -927,14 +927,14 @@ static StackWalkAction TAStackCrawlCallBackWorker(CrawlFrame* pCf, StackCrawlCon } } -#ifdef _TARGET_X86_ +#ifndef WIN64EXCEPTIONS #ifdef _DEBUG if (fAtJitEndCatch) { _ASSERTE (countInCatch > 0); } #endif // _DEBUG -#endif // _TARGET_X86_ +#endif // !WIN64EXCEPTIONS_ return action; } @@ -1345,7 +1345,7 @@ BOOL Thread::IsSafeToInjectThreadAbort(PTR_CONTEXT pContextToCheck) #endif -BOOL Thread::ReadyForAsyncException(ThreadInterruptMode mode) +BOOL Thread::ReadyForAsyncException() { CONTRACTL { NOTHROW; @@ -1354,8 +1354,7 @@ BOOL Thread::ReadyForAsyncException(ThreadInterruptMode mode) } CONTRACTL_END; - if (((mode & TI_Abort) != 0 && !IsAbortRequested()) || - ((mode & TI_Interrupt) != 0 && (m_UserInterrupt & TI_Interrupt) == 0)) + if (!IsAbortRequested()) { return FALSE; } @@ -2190,7 +2189,7 @@ LRetry: | TS_Detached | TS_Unstarted))); -#ifdef _TARGET_X86_ +#if defined(_TARGET_X86_) && !defined(WIN64EXCEPTIONS) // TODO WIN64: consider this if there is a way to detect of managed code on stack. if ((m_pFrame == FRAME_TOP) && (GetFirstCOMPlusSEHRecord(this) == EXCEPTION_CHAIN_END) @@ -2213,7 +2212,7 @@ LRetry: if (!m_fPreemptiveGCDisabled) { if ((m_pFrame != FRAME_TOP) && m_pFrame->IsTransitionToNativeFrame() -#ifdef _TARGET_X86_ +#if defined(_TARGET_X86_) && !defined(WIN64EXCEPTIONS) && ((size_t) GetFirstCOMPlusSEHRecord(this) > ((size_t) m_pFrame) - 20) #endif // _TARGET_X86_ ) @@ -7019,7 +7018,7 @@ StackWalkAction SWCB_GetExecutionState(CrawlFrame *pCF, VOID *pData) // return address for hijacking. if (!pES->m_IsInterruptible) { -#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_) +#ifdef WIN64EXCEPTIONS PREGDISPLAY pRDT = pCF->GetRegisterSet(); _ASSERTE(pRDT != NULL); @@ -7076,15 +7075,17 @@ StackWalkAction SWCB_GetExecutionState(CrawlFrame *pCF, VOID *pData) // in the caller of the current non-interruptible frame. pES->m_ppvRetAddrPtr = (void **) pRDT->pCallerContextPointers->Lr; } -#else - pES->m_ppvRetAddrPtr = (void **) ((size_t)GetSP(pRDT->pCallerContext) - sizeof(void*)); -#endif +#elif defined(_TARGET_X86_) || defined(_TARGET_AMD64_) + pES->m_ppvRetAddrPtr = (void **) (EECodeManager::GetCallerSp(pRDT) - sizeof(void*)); +#else // _TARGET_X86_ || _TARGET_AMD64_ + PORTABILITY_ASSERT("Platform NYI"); +#endif // _TARGET_???_ } -#else +#else // WIN64EXCEPTIONS // peel off the next frame to expose the return address on the stack pES->m_FirstPass = FALSE; action = SWA_CONTINUE; -#endif // _TARGET_AMD64_ || _TARGET_ARM_ || _TARGET_ARM64_ +#endif // !WIN64EXCEPTIONS } #endif // HIJACK_NONINTERRUPTIBLE_THREADS } @@ -7113,7 +7114,7 @@ StackWalkAction SWCB_GetExecutionState(CrawlFrame *pCF, VOID *pData) } else { -#ifdef _TARGET_X86_ +#if defined(_TARGET_X86_) && !defined(WIN64EXCEPTIONS) // Second pass, looking for the address of the return address so we can // hijack: |