Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit f2e5252

Browse files
Konstantin Baladurinjkotas
authored andcommitted
dllimportcallback: remove code for CallbackOnCollectedDelegate MDA
1 parent b0a10f6 commit f2e5252

File tree

2 files changed

+0
-90
lines changed

2 files changed

+0
-90
lines changed

src/vm/dllimportcallback.cpp

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -112,34 +112,6 @@ EXTERN_C void STDCALL UM2MThunk_WrapperHelper(void *pThunkArgs,
112112
UMEntryThunk *pEntryThunk,
113113
Thread *pThread);
114114

115-
#ifdef MDA_SUPPORTED
116-
EXTERN_C void __fastcall CallbackOnCollectedDelegateHelper(UMEntryThunk *pEntryThunk)
117-
{
118-
CONTRACTL
119-
{
120-
THROWS;
121-
GC_TRIGGERS;
122-
MODE_COOPERATIVE;
123-
SO_TOLERANT;
124-
PRECONDITION(CheckPointer(pEntryThunk));
125-
}
126-
CONTRACTL_END;
127-
128-
MdaCallbackOnCollectedDelegate* pProbe = MDA_GET_ASSISTANT(CallbackOnCollectedDelegate);
129-
130-
// This MDA must be active if we generated a call to CallbackOnCollectedDelegateHelper
131-
_ASSERTE(pProbe);
132-
133-
if (pEntryThunk->IsCollected())
134-
{
135-
INSTALL_UNWIND_AND_CONTINUE_HANDLER;
136-
pProbe->ReportViolation(pEntryThunk->GetMethod());
137-
COMPlusThrow(kNullReferenceException);
138-
UNINSTALL_UNWIND_AND_CONTINUE_HANDLER;
139-
}
140-
}
141-
#endif // MDA_SUPPORTED
142-
143115
// This is used as target of callback from DoADCallBack. It sets up the environment and effectively
144116
// calls back into the thunk that needed to switch ADs.
145117
void UM2MThunk_Wrapper(LPVOID ptr) // UM2MThunk_Args
@@ -412,25 +384,6 @@ VOID UMEntryThunk::CompileUMThunkWorker(UMThunkStubInfo *pInfo,
412384
// would deadlock).
413385
pcpusl->EmitLabel(pDoADCallBackStartLabel);
414386

415-
416-
#ifdef MDA_SUPPORTED
417-
if ((pInfo->m_wFlags & umtmlSkipStub) && !(pInfo->m_wFlags & umtmlIsStatic) &&
418-
MDA_GET_ASSISTANT(CallbackOnCollectedDelegate))
419-
{
420-
// save registers
421-
pcpusl->X86EmitPushReg(kEAXentryThunk);
422-
pcpusl->X86EmitPushReg(kECXthread);
423-
424-
// CallbackOnCollectedDelegateHelper is a fast call
425-
pcpusl->X86EmitMovRegReg(kECX, kEAXentryThunk);
426-
pcpusl->X86EmitCall(pcpusl->NewExternalCodeLabel((LPVOID)CallbackOnCollectedDelegateHelper), 0);
427-
428-
// restore registers
429-
pcpusl->X86EmitPopReg(kECXthread);
430-
pcpusl->X86EmitPopReg(kEAXentryThunk);
431-
}
432-
#endif
433-
434387
// save the thread pointer
435388
pcpusl->X86EmitPushReg(kECXthread);
436389

@@ -1217,30 +1170,6 @@ VOID UMEntryThunk::FreeUMEntryThunk(UMEntryThunk* p)
12171170
}
12181171
CONTRACTL_END;
12191172

1220-
#ifdef MDA_SUPPORTED
1221-
MdaCallbackOnCollectedDelegate* pProbe = MDA_GET_ASSISTANT(CallbackOnCollectedDelegate);
1222-
if (pProbe)
1223-
{
1224-
if (p->GetObjectHandle())
1225-
{
1226-
DestroyLongWeakHandle(p->GetObjectHandle());
1227-
p->m_pObjectHandle = NULL;
1228-
1229-
// We are intentionally not reseting m_pManagedTarget here so that
1230-
// it is available for diagnostics of call on collected delegate crashes.
1231-
}
1232-
else
1233-
{
1234-
p->m_pManagedTarget = NULL;
1235-
}
1236-
1237-
// Add this to the array of delegates to be cleaned up.
1238-
pProbe->AddToList(p);
1239-
1240-
return;
1241-
}
1242-
#endif
1243-
12441173
p->Terminate();
12451174
}
12461175

src/vm/dllimportcallback.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,7 @@ class UMEntryThunk
424424
MODE_ANY;
425425
SUPPORTS_DAC;
426426
PRECONDITION(m_state == kRunTimeInited || m_state == kLoadTimeInited);
427-
#ifdef MDA_SUPPORTED
428-
// We can return NULL here if the CollectedDelegate probe is on because
429-
// a collected delegate will have set this field to NULL.
430-
POSTCONDITION(g_pDebugInterface->ThisIsHelperThread() || MDA_GET_ASSISTANT(CallbackOnCollectedDelegate) || CheckPointer(RETVAL));
431-
#else
432427
POSTCONDITION(CheckPointer(RETVAL));
433-
#endif
434428
}
435429
CONTRACT_END;
436430

@@ -503,15 +497,6 @@ class UMEntryThunk
503497

504498
static UMEntryThunk* Decode(LPVOID pCallback);
505499

506-
#ifdef MDA_SUPPORTED
507-
BOOL IsCollected() const
508-
{
509-
LIMITED_METHOD_CONTRACT;
510-
_ASSERTE(m_pMD != NULL && m_pMD->IsEEImpl());
511-
return m_pObjectHandle == NULL;
512-
}
513-
#endif
514-
515500
static VOID __fastcall ReportViolation(UMEntryThunk* p);
516501

517502
private:
@@ -613,8 +598,4 @@ EXTERN_C void UMThunkStub(void);
613598
void STDCALL LogUMTransition(UMEntryThunk* thunk);
614599
#endif
615600

616-
#ifdef MDA_SUPPORTED
617-
EXTERN_C void __fastcall CallbackOnCollectedDelegateHelper(UMEntryThunk *pEntryThunk);
618-
#endif // MDA_SUPPORTED
619-
620601
#endif //__dllimportcallback_h__

0 commit comments

Comments
 (0)