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

Commit e6d00a3

Browse files
Merge pull request #13166 from YongseopKim/ryujit/arm32/add_handling_secure_delegate_inv
[RyuJIT/ARM32] Adds code to handle SecureDelegateInvoke
2 parents eeb1efd + 36a1deb commit e6d00a3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/jit/morph.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,6 +2878,37 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call)
28782878
nonStandardArgs.Add(arg1, REG_PINVOKE_FRAME);
28792879
}
28802880
#endif // defined(_TARGET_X86_) || defined(_TARGET_ARM_)
2881+
#if defined(_TARGET_ARM_)
2882+
else if (call->gtCallMoreFlags & GTF_CALL_M_SECURE_DELEGATE_INV)
2883+
{
2884+
GenTree* arg = call->gtCallObjp;
2885+
if (arg->OperIsLocal())
2886+
{
2887+
arg = gtClone(arg, true);
2888+
}
2889+
else
2890+
{
2891+
GenTree* tmp = fgInsertCommaFormTemp(&arg);
2892+
call->gtCallObjp = arg;
2893+
call->gtFlags |= GTF_ASG;
2894+
arg = tmp;
2895+
}
2896+
noway_assert(arg != nullptr);
2897+
2898+
GenTree* newArg = new (this, GT_ADDR)
2899+
GenTreeAddrMode(TYP_REF, arg, nullptr, 0, eeGetEEInfo()->offsetOfSecureDelegateIndirectCell);
2900+
2901+
// Append newArg as the last arg
2902+
GenTreeArgList** insertionPoint = &call->gtCallArgs;
2903+
for (; *insertionPoint != nullptr; insertionPoint = &(*insertionPoint)->Rest())
2904+
{
2905+
}
2906+
*insertionPoint = gtNewListNode(newArg, nullptr);
2907+
2908+
numArgs++;
2909+
nonStandardArgs.Add(newArg, virtualStubParamInfo->GetReg());
2910+
}
2911+
#endif // defined(_TARGET_ARM_)
28812912
#if defined(_TARGET_X86_)
28822913
// The x86 shift helpers have custom calling conventions and expect the lo part of the long to be in EAX and the
28832914
// hi part to be in EDX. This sets the argument registers up correctly.

0 commit comments

Comments
 (0)