-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Enable FEATURE_STUBS_AS_IL for ARM/Linux #6500
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2596,7 +2596,7 @@ BOOL COMDelegate::NeedsWrapperDelegate(MethodDesc* pTargetMD) | |
#ifdef _TARGET_ARM_ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not think it is ok to just return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jkotas Without this, I encountered Could you let me know which changes are required for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that implementing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remove my email address from DW? I think this discussion does not 28 lip 2016 4:06 PM "Jan Kotas" [email protected] napisał(a):
|
||
// For arm VSD expects r4 to contain the indirection cell. However r4 is a non-volatile register | ||
// and its value must be preserved. So we need to erect a frame and store indirection cell in r4 before calling | ||
// virtual stub dispatch. Erecting frame is already done by secure delegates so the secureDelegate infrastructure | ||
// virtual stub dispatch. Erecting frame is already done by secure delegates so the secureDelegate infrastructure | ||
// can easliy be used for our purpose. | ||
// set needsSecureDelegate flag in order to erect a frame. (Secure Delegate stub also loads the right value in r4) | ||
if (!pTargetMD->IsStatic() && pTargetMD->IsVirtual() && !pTargetMD->GetMethodTable()->IsValueType()) | ||
|
@@ -2931,7 +2931,47 @@ PCODE COMDelegate::GetSecureInvoke(MethodDesc* pMD) | |
#ifdef FEATURE_CAS_POLICY | ||
#error GetSecureInvoke not implemented | ||
#else | ||
UNREACHABLE(); | ||
GCX_PREEMP(); | ||
|
||
MetaSig sig(pMD); | ||
|
||
BOOL fReturnVal = !sig.IsReturnTypeVoid(); | ||
|
||
SigTypeContext emptyContext; | ||
ILStubLinker sl(pMD->GetModule(), pMD->GetSignature(), &emptyContext, pMD, TRUE, TRUE, FALSE); | ||
|
||
ILCodeStream *pCode = sl.NewCodeStream(ILStubLinker::kDispatch); | ||
|
||
// Load the "real" delegate | ||
pCode->EmitLoadThis(); | ||
pCode->EmitLDFLD(pCode->GetToken(MscorlibBinder::GetField(FIELD__MULTICAST_DELEGATE__INVOCATION_LIST))); | ||
|
||
// Load the arguments | ||
UINT paramCount = 0; | ||
while(paramCount < sig.NumFixedArgs()) | ||
pCode->EmitLDARG(paramCount++); | ||
|
||
// Call the delegate | ||
pCode->EmitCALL(pCode->GetToken(pMD), sig.NumFixedArgs(), fReturnVal); | ||
|
||
// Return | ||
pCode->EmitRET(); | ||
|
||
PCCOR_SIGNATURE pSig; | ||
DWORD cbSig; | ||
|
||
pMD->GetSig(&pSig,&cbSig); | ||
|
||
MethodDesc* pStubMD = | ||
ILStubCache::CreateAndLinkNewILStubMethodDesc(pMD->GetLoaderAllocator(), | ||
pMD->GetMethodTable(), | ||
ILSTUB_SECUREDELEGATE_INVOKE, | ||
pMD->GetModule(), | ||
pSig, cbSig, | ||
NULL, | ||
&sl); | ||
|
||
return Stub::NewStub(JitILStub(pStubMD))->GetEntryPoint(); | ||
#endif | ||
} | ||
#else // FEATURE_STUBS_AS_IL | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It maybe a good idea to put it under ARM ifdef since this is ARM-specific code.