Skip to content

Remove RCWAuxiliaryData #38255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 0 additions & 127 deletions src/coreclr/src/vm/comtoclrcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,49 +272,6 @@ OBJECTREF COMToCLRGetObjectAndTarget_Delegate(ComCallWrapper * pWrap, PCODE * pp
return pDelObj->GetTarget();
}

// returns true on success, false otherwise
NOINLINE // keep the EH tax out of our caller
bool COMToCLRGetObjectAndTarget_WinRTCtor(Thread * pThread, MethodDesc * pRealMD, ComCallMethodDesc * pCMD, PCODE * ppManagedTargetOut,
OBJECTREF* pObjectOut, UINT64* pRetValOut)
{
CONTRACTL
{
NOTHROW;
GC_TRIGGERS;
MODE_COOPERATIVE;
}
CONTRACTL_END;

// Ctor is not virtual and operates on a newly created object.
_ASSERTE(!pCMD->IsVirtual());

*pObjectOut = NULL;
*ppManagedTargetOut = pRealMD->GetSingleCallableAddrOfCode();
MethodTable *pMT = pRealMD->GetMethodTable();

// We should not see a unsealed class here
_ASSERTE(pMT->IsSealed());

// we know for sure that we are allocating a new object

// @TODO: move this object allocation into the IL stub to avoid the try/catch and SO-intolerant region.

bool fSuccess = true;

EX_TRY
{
*pObjectOut = AllocateObject(pMT);
}
EX_CATCH
{
fSuccess = false;
*pRetValOut = SetupErrorInfo(GET_THROWABLE());
}
EX_END_CATCH(SwallowAllExceptions);

return fSuccess;
}

FORCEINLINE_NONDEBUG
OBJECTREF COMToCLRGetObjectAndTarget_Virtual(ComCallWrapper * pWrap, MethodDesc * pRealMD, ComCallMethodDesc * pCMD, PCODE * ppManagedTargetOut)
{
Expand Down Expand Up @@ -1537,88 +1494,4 @@ MethodDesc* ComCall::GetILStubMethodDesc(FieldDesc *pFD, DWORD dwStubFlags)
pFD);
}

// static
MethodDesc *ComCall::GetCtorForWinRTFactoryMethod(MethodTable *pClsMT, MethodDesc *pMD)
{
CONTRACTL
{
THROWS;
GC_TRIGGERS;
MODE_ANY;
PRECONDITION(pClsMT->IsSealed());
}
CONTRACTL_END;

PCCOR_SIGNATURE pSig;
DWORD cSig;
pMD->GetSig(&pSig, &cSig);
SigParser sig(pSig, cSig);

ULONG numArgs;

IfFailThrow(sig.GetCallingConv(NULL)); // calling convention
IfFailThrow(sig.GetData(&numArgs)); // number of args
IfFailThrow(sig.SkipExactlyOne()); // skip return type

SigBuilder sigBuilder;
sigBuilder.AppendByte(IMAGE_CEE_CS_CALLCONV_HASTHIS);
sigBuilder.AppendData(numArgs);

// ctor returns void
sigBuilder.AppendElementType(ELEMENT_TYPE_VOID);

sig.GetSignature(&pSig, &cSig);

// parameter types are identical for sealed classes
sigBuilder.AppendBlob((const PVOID)pSig, cSig);

pSig = (PCCOR_SIGNATURE)sigBuilder.GetSignature(&cSig);

MethodDesc *pCtorMD = MemberLoader::FindMethod(pClsMT, COR_CTOR_METHOD_NAME, pSig, cSig, pMD->GetModule());

if (pCtorMD == NULL)
{
SString ctorMethodName(SString::Utf8, COR_CTOR_METHOD_NAME);
COMPlusThrowNonLocalized(kMissingMethodException, ctorMethodName.GetUnicode());
}
return pCtorMD;
}

// static
MethodDesc *ComCall::GetStaticForWinRTFactoryMethod(MethodTable *pClsMT, MethodDesc *pMD)
{
CONTRACTL
{
THROWS;
GC_TRIGGERS;
MODE_ANY;
}
CONTRACTL_END;

PCCOR_SIGNATURE pSig;
DWORD cSig;
pMD->GetSig(&pSig, &cSig);
SigParser sig(pSig, cSig);

IfFailThrow(sig.GetCallingConv(NULL)); // calling convention

SigBuilder sigBuilder;
sigBuilder.AppendByte(IMAGE_CEE_CS_CALLCONV_DEFAULT);

// number of parameters, return type, and parameter types are identical
sig.GetSignature(&pSig, &cSig);
sigBuilder.AppendBlob((const PVOID)pSig, cSig);

pSig = (PCCOR_SIGNATURE)sigBuilder.GetSignature(&cSig);

MethodDesc *pStaticMD = MemberLoader::FindMethod(pClsMT, pMD->GetName(), pSig, cSig, pMD->GetModule());

if (pStaticMD == NULL)
{
SString staticMethodName(SString::Utf8, pMD->GetName());
COMPlusThrowNonLocalized(kMissingMethodException, staticMethodName.GetUnicode());
}
return pStaticMD;
}

#endif // DACCESS_COMPILE
3 changes: 0 additions & 3 deletions src/coreclr/src/vm/comtoclrcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ class ComCall
static MethodDesc* GetILStubMethodDesc(MethodDesc *pCallMD, DWORD dwStubFlags);
static MethodDesc* GetILStubMethodDesc(FieldDesc *pFD, DWORD dwStubFlags);

static MethodDesc *GetCtorForWinRTFactoryMethod(MethodTable *pClsMT, MethodDesc *pMD);
static MethodDesc *GetStaticForWinRTFactoryMethod(MethodTable *pClsMT, MethodDesc *pMD);

private:
ComCall() {LIMITED_METHOD_CONTRACT;}; // prevent "new"'s on this class

Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/src/vm/dllimport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,9 +1532,6 @@ NDirectStubLinker::NDirectStubLinker(
m_pCleanupFinallyBeginLabel(NULL),
m_pCleanupFinallyEndLabel(NULL),
m_pSkipExceptionCleanupLabel(NULL),
#ifdef FEATURE_COMINTEROP
m_dwWinRTFactoryObjectLocalNum(-1),
#endif // FEATURE_COMINTEROP
m_fHasCleanupCode(FALSE),
m_fHasExceptionCleanupCode(FALSE),
m_fCleanupWorkListIsSetup(FALSE),
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/src/vm/dllimport.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ class NDirectStubLinker : public ILStubLinker
#ifdef FEATURE_COMINTEROP
DWORD m_dwTargetInterfacePointerLocalNum;
DWORD m_dwTargetEntryPointLocalNum;
DWORD m_dwWinRTFactoryObjectLocalNum;
#endif // FEATURE_COMINTEROP

BOOL m_fHasCleanupCode;
Expand Down
37 changes: 0 additions & 37 deletions src/coreclr/src/vm/interoputil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4520,43 +4520,6 @@ MethodTable* GetClassFromIProvideClassInfo(IUnknown* pUnk)

#endif // FEATURE_COMINTEROP

static void DECLSPEC_NORETURN ThrowTypeLoadExceptionWithInner(MethodTable *pClassMT, LPCWSTR pwzName, HRESULT hr, unsigned resID)
{
CONTRACTL
{
THROWS;
DISABLED(GC_NOTRIGGER); // Must sanitize first pass handling to enable this
MODE_ANY;
}
CONTRACTL_END;

StackSString simpleName(SString::Utf8, pClassMT->GetAssembly()->GetSimpleName());

EEMessageException ex(hr);
EX_THROW_WITH_INNER(EETypeLoadException, (pwzName, simpleName.GetUnicode(), nullptr, resID), &ex);
}

//
// Creates activation factory and wraps it with a RCW
//
void GetNativeWinRTFactoryObject(MethodTable *pMT, Thread *pThread, MethodTable *pFactoryIntfMT, BOOL bNeedUniqueRCW, ICOMInterfaceMarshalerCallback *pCallback, OBJECTREF *prefFactory)
{
CONTRACTL
{
THROWS;
MODE_COOPERATIVE;
GC_TRIGGERS;
PRECONDITION(CheckPointer(pMT));
PRECONDITION(CheckPointer(pThread));
PRECONDITION(CheckPointer(pFactoryIntfMT, NULL_OK));
PRECONDITION(CheckPointer(pCallback, NULL_OK));
}
CONTRACTL_END;

COMPlusThrow(kPlatformNotSupportedException, W("PlatformNotSupported_WinRT"));
}

#endif //#ifndef CROSSGEN_COMPILE


#endif // FEATURE_COMINTEROP
8 changes: 0 additions & 8 deletions src/coreclr/src/vm/methodtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -2976,14 +2976,6 @@ class MethodTable
// Get and cache the GUID for this interface/class
void GetGuid(GUID *pGuid, BOOL bGenerateIfNotFound, BOOL bClassic = TRUE);

#ifdef FEATURE_COMINTEROP
// Get the GUID used for WinRT interop
// * for projection generic interfaces returns the equivalent WinRT type's GUID
// * for everything else returns the GetGuid(, TRUE)
BOOL GetGuidForWinRT(GUID *pGuid);

#endif // FEATURE_COMINTEROP

// Convenience method - determine if the interface/class has a guid specified (even if not yet cached)
BOOL HasExplicitGuid();

Expand Down
15 changes: 0 additions & 15 deletions src/coreclr/src/vm/methodtable.inl
Original file line number Diff line number Diff line change
Expand Up @@ -362,21 +362,6 @@ inline BOOL MethodTable::HasExplicitGuid()
return (guid != GUID_NULL);
}

//==========================================================================================
// Get the GUID used for WinRT interop
// * if the type is not a WinRT type or a redirected interfae return FALSE
inline BOOL MethodTable::GetGuidForWinRT(GUID *pGuid)
{
CONTRACTL {
THROWS;
GC_TRIGGERS;
MODE_ANY;
SUPPORTS_DAC;
} CONTRACTL_END;

return FALSE;
}

#endif // FEATURE_COMINTEROP

//==========================================================================================
Expand Down
Loading