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

[RyuJIT/ARM32] Adds code to handle SecureDelegateInvoke #13166

Merged
merged 1 commit into from
Aug 3, 2017
Merged
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
31 changes: 31 additions & 0 deletions src/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2878,6 +2878,37 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
nonStandardArgs.Add(arg1, REG_PINVOKE_FRAME);
}
#endif // defined(_TARGET_X86_) || defined(_TARGET_ARM_)
#if defined(_TARGET_ARM_)
else if (call->gtCallMoreFlags & GTF_CALL_M_SECURE_DELEGATE_INV)
{
GenTree* arg = call->gtCallObjp;
if (arg->OperIsLocal())
{
arg = gtClone(arg, true);
}
else
{
GenTree* tmp = fgInsertCommaFormTemp(&arg);
call->gtCallObjp = arg;
call->gtFlags |= GTF_ASG;
arg = tmp;
}
noway_assert(arg != nullptr);

GenTree* newArg = new (this, GT_ADDR)
GenTreeAddrMode(TYP_REF, arg, nullptr, 0, eeGetEEInfo()->offsetOfSecureDelegateIndirectCell);

// Append newArg as the last arg
GenTreeArgList** insertionPoint = &call->gtCallArgs;
for (; *insertionPoint != nullptr; insertionPoint = &(*insertionPoint)->Rest())
{
}
*insertionPoint = gtNewListNode(newArg, nullptr);

numArgs++;
nonStandardArgs.Add(newArg, virtualStubParamInfo->GetReg());
}
#endif // defined(_TARGET_ARM_)
#if defined(_TARGET_X86_)
// The x86 shift helpers have custom calling conventions and expect the lo part of the long to be in EAX and the
// hi part to be in EDX. This sets the argument registers up correctly.
Expand Down