Skip to content

Commit a18403f

Browse files
authored
Remove RCWAuxiliaryData (#38255)
* Remove RCWAuxiliaryData * Remove unused functions
1 parent 81ed1f7 commit a18403f

File tree

10 files changed

+17
-753
lines changed

10 files changed

+17
-753
lines changed

src/coreclr/src/vm/comtoclrcall.cpp

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -272,49 +272,6 @@ OBJECTREF COMToCLRGetObjectAndTarget_Delegate(ComCallWrapper * pWrap, PCODE * pp
272272
return pDelObj->GetTarget();
273273
}
274274

275-
// returns true on success, false otherwise
276-
NOINLINE // keep the EH tax out of our caller
277-
bool COMToCLRGetObjectAndTarget_WinRTCtor(Thread * pThread, MethodDesc * pRealMD, ComCallMethodDesc * pCMD, PCODE * ppManagedTargetOut,
278-
OBJECTREF* pObjectOut, UINT64* pRetValOut)
279-
{
280-
CONTRACTL
281-
{
282-
NOTHROW;
283-
GC_TRIGGERS;
284-
MODE_COOPERATIVE;
285-
}
286-
CONTRACTL_END;
287-
288-
// Ctor is not virtual and operates on a newly created object.
289-
_ASSERTE(!pCMD->IsVirtual());
290-
291-
*pObjectOut = NULL;
292-
*ppManagedTargetOut = pRealMD->GetSingleCallableAddrOfCode();
293-
MethodTable *pMT = pRealMD->GetMethodTable();
294-
295-
// We should not see a unsealed class here
296-
_ASSERTE(pMT->IsSealed());
297-
298-
// we know for sure that we are allocating a new object
299-
300-
// @TODO: move this object allocation into the IL stub to avoid the try/catch and SO-intolerant region.
301-
302-
bool fSuccess = true;
303-
304-
EX_TRY
305-
{
306-
*pObjectOut = AllocateObject(pMT);
307-
}
308-
EX_CATCH
309-
{
310-
fSuccess = false;
311-
*pRetValOut = SetupErrorInfo(GET_THROWABLE());
312-
}
313-
EX_END_CATCH(SwallowAllExceptions);
314-
315-
return fSuccess;
316-
}
317-
318275
FORCEINLINE_NONDEBUG
319276
OBJECTREF COMToCLRGetObjectAndTarget_Virtual(ComCallWrapper * pWrap, MethodDesc * pRealMD, ComCallMethodDesc * pCMD, PCODE * ppManagedTargetOut)
320277
{
@@ -1537,88 +1494,4 @@ MethodDesc* ComCall::GetILStubMethodDesc(FieldDesc *pFD, DWORD dwStubFlags)
15371494
pFD);
15381495
}
15391496

1540-
// static
1541-
MethodDesc *ComCall::GetCtorForWinRTFactoryMethod(MethodTable *pClsMT, MethodDesc *pMD)
1542-
{
1543-
CONTRACTL
1544-
{
1545-
THROWS;
1546-
GC_TRIGGERS;
1547-
MODE_ANY;
1548-
PRECONDITION(pClsMT->IsSealed());
1549-
}
1550-
CONTRACTL_END;
1551-
1552-
PCCOR_SIGNATURE pSig;
1553-
DWORD cSig;
1554-
pMD->GetSig(&pSig, &cSig);
1555-
SigParser sig(pSig, cSig);
1556-
1557-
ULONG numArgs;
1558-
1559-
IfFailThrow(sig.GetCallingConv(NULL)); // calling convention
1560-
IfFailThrow(sig.GetData(&numArgs)); // number of args
1561-
IfFailThrow(sig.SkipExactlyOne()); // skip return type
1562-
1563-
SigBuilder sigBuilder;
1564-
sigBuilder.AppendByte(IMAGE_CEE_CS_CALLCONV_HASTHIS);
1565-
sigBuilder.AppendData(numArgs);
1566-
1567-
// ctor returns void
1568-
sigBuilder.AppendElementType(ELEMENT_TYPE_VOID);
1569-
1570-
sig.GetSignature(&pSig, &cSig);
1571-
1572-
// parameter types are identical for sealed classes
1573-
sigBuilder.AppendBlob((const PVOID)pSig, cSig);
1574-
1575-
pSig = (PCCOR_SIGNATURE)sigBuilder.GetSignature(&cSig);
1576-
1577-
MethodDesc *pCtorMD = MemberLoader::FindMethod(pClsMT, COR_CTOR_METHOD_NAME, pSig, cSig, pMD->GetModule());
1578-
1579-
if (pCtorMD == NULL)
1580-
{
1581-
SString ctorMethodName(SString::Utf8, COR_CTOR_METHOD_NAME);
1582-
COMPlusThrowNonLocalized(kMissingMethodException, ctorMethodName.GetUnicode());
1583-
}
1584-
return pCtorMD;
1585-
}
1586-
1587-
// static
1588-
MethodDesc *ComCall::GetStaticForWinRTFactoryMethod(MethodTable *pClsMT, MethodDesc *pMD)
1589-
{
1590-
CONTRACTL
1591-
{
1592-
THROWS;
1593-
GC_TRIGGERS;
1594-
MODE_ANY;
1595-
}
1596-
CONTRACTL_END;
1597-
1598-
PCCOR_SIGNATURE pSig;
1599-
DWORD cSig;
1600-
pMD->GetSig(&pSig, &cSig);
1601-
SigParser sig(pSig, cSig);
1602-
1603-
IfFailThrow(sig.GetCallingConv(NULL)); // calling convention
1604-
1605-
SigBuilder sigBuilder;
1606-
sigBuilder.AppendByte(IMAGE_CEE_CS_CALLCONV_DEFAULT);
1607-
1608-
// number of parameters, return type, and parameter types are identical
1609-
sig.GetSignature(&pSig, &cSig);
1610-
sigBuilder.AppendBlob((const PVOID)pSig, cSig);
1611-
1612-
pSig = (PCCOR_SIGNATURE)sigBuilder.GetSignature(&cSig);
1613-
1614-
MethodDesc *pStaticMD = MemberLoader::FindMethod(pClsMT, pMD->GetName(), pSig, cSig, pMD->GetModule());
1615-
1616-
if (pStaticMD == NULL)
1617-
{
1618-
SString staticMethodName(SString::Utf8, pMD->GetName());
1619-
COMPlusThrowNonLocalized(kMissingMethodException, staticMethodName.GetUnicode());
1620-
}
1621-
return pStaticMD;
1622-
}
1623-
16241497
#endif // DACCESS_COMPILE

src/coreclr/src/vm/comtoclrcall.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ class ComCall
8787
static MethodDesc* GetILStubMethodDesc(MethodDesc *pCallMD, DWORD dwStubFlags);
8888
static MethodDesc* GetILStubMethodDesc(FieldDesc *pFD, DWORD dwStubFlags);
8989

90-
static MethodDesc *GetCtorForWinRTFactoryMethod(MethodTable *pClsMT, MethodDesc *pMD);
91-
static MethodDesc *GetStaticForWinRTFactoryMethod(MethodTable *pClsMT, MethodDesc *pMD);
92-
9390
private:
9491
ComCall() {LIMITED_METHOD_CONTRACT;}; // prevent "new"'s on this class
9592

src/coreclr/src/vm/dllimport.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,9 +1532,6 @@ NDirectStubLinker::NDirectStubLinker(
15321532
m_pCleanupFinallyBeginLabel(NULL),
15331533
m_pCleanupFinallyEndLabel(NULL),
15341534
m_pSkipExceptionCleanupLabel(NULL),
1535-
#ifdef FEATURE_COMINTEROP
1536-
m_dwWinRTFactoryObjectLocalNum(-1),
1537-
#endif // FEATURE_COMINTEROP
15381535
m_fHasCleanupCode(FALSE),
15391536
m_fHasExceptionCleanupCode(FALSE),
15401537
m_fCleanupWorkListIsSetup(FALSE),

src/coreclr/src/vm/dllimport.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ class NDirectStubLinker : public ILStubLinker
542542
#ifdef FEATURE_COMINTEROP
543543
DWORD m_dwTargetInterfacePointerLocalNum;
544544
DWORD m_dwTargetEntryPointLocalNum;
545-
DWORD m_dwWinRTFactoryObjectLocalNum;
546545
#endif // FEATURE_COMINTEROP
547546

548547
BOOL m_fHasCleanupCode;

src/coreclr/src/vm/interoputil.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4520,43 +4520,6 @@ MethodTable* GetClassFromIProvideClassInfo(IUnknown* pUnk)
45204520

45214521
#endif // FEATURE_COMINTEROP
45224522

4523-
static void DECLSPEC_NORETURN ThrowTypeLoadExceptionWithInner(MethodTable *pClassMT, LPCWSTR pwzName, HRESULT hr, unsigned resID)
4524-
{
4525-
CONTRACTL
4526-
{
4527-
THROWS;
4528-
DISABLED(GC_NOTRIGGER); // Must sanitize first pass handling to enable this
4529-
MODE_ANY;
4530-
}
4531-
CONTRACTL_END;
4532-
4533-
StackSString simpleName(SString::Utf8, pClassMT->GetAssembly()->GetSimpleName());
4534-
4535-
EEMessageException ex(hr);
4536-
EX_THROW_WITH_INNER(EETypeLoadException, (pwzName, simpleName.GetUnicode(), nullptr, resID), &ex);
4537-
}
4538-
4539-
//
4540-
// Creates activation factory and wraps it with a RCW
4541-
//
4542-
void GetNativeWinRTFactoryObject(MethodTable *pMT, Thread *pThread, MethodTable *pFactoryIntfMT, BOOL bNeedUniqueRCW, ICOMInterfaceMarshalerCallback *pCallback, OBJECTREF *prefFactory)
4543-
{
4544-
CONTRACTL
4545-
{
4546-
THROWS;
4547-
MODE_COOPERATIVE;
4548-
GC_TRIGGERS;
4549-
PRECONDITION(CheckPointer(pMT));
4550-
PRECONDITION(CheckPointer(pThread));
4551-
PRECONDITION(CheckPointer(pFactoryIntfMT, NULL_OK));
4552-
PRECONDITION(CheckPointer(pCallback, NULL_OK));
4553-
}
4554-
CONTRACTL_END;
4555-
4556-
COMPlusThrow(kPlatformNotSupportedException, W("PlatformNotSupported_WinRT"));
4557-
}
4558-
45594523
#endif //#ifndef CROSSGEN_COMPILE
45604524

4561-
45624525
#endif // FEATURE_COMINTEROP

src/coreclr/src/vm/methodtable.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2976,14 +2976,6 @@ class MethodTable
29762976
// Get and cache the GUID for this interface/class
29772977
void GetGuid(GUID *pGuid, BOOL bGenerateIfNotFound, BOOL bClassic = TRUE);
29782978

2979-
#ifdef FEATURE_COMINTEROP
2980-
// Get the GUID used for WinRT interop
2981-
// * for projection generic interfaces returns the equivalent WinRT type's GUID
2982-
// * for everything else returns the GetGuid(, TRUE)
2983-
BOOL GetGuidForWinRT(GUID *pGuid);
2984-
2985-
#endif // FEATURE_COMINTEROP
2986-
29872979
// Convenience method - determine if the interface/class has a guid specified (even if not yet cached)
29882980
BOOL HasExplicitGuid();
29892981

src/coreclr/src/vm/methodtable.inl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -362,21 +362,6 @@ inline BOOL MethodTable::HasExplicitGuid()
362362
return (guid != GUID_NULL);
363363
}
364364

365-
//==========================================================================================
366-
// Get the GUID used for WinRT interop
367-
// * if the type is not a WinRT type or a redirected interfae return FALSE
368-
inline BOOL MethodTable::GetGuidForWinRT(GUID *pGuid)
369-
{
370-
CONTRACTL {
371-
THROWS;
372-
GC_TRIGGERS;
373-
MODE_ANY;
374-
SUPPORTS_DAC;
375-
} CONTRACTL_END;
376-
377-
return FALSE;
378-
}
379-
380365
#endif // FEATURE_COMINTEROP
381366

382367
//==========================================================================================

0 commit comments

Comments
 (0)