firstTgtOffs = pInfo->offsetOfDelegateFirstTarget;
#ifdef _TARGET_ARM_
+ // Ensure that we don't trash any of these registers if we have to load
+ // the helper call target into a register to invoke it.
+ regMaskTP regsUsed;
+
if ((call->gtCallMoreFlags & GTF_CALL_M_SECURE_DELEGATE_INV))
{
- getEmitter()->emitIns_R_R_I(INS_add, EA_PTRSIZE, compiler->virtualStubParamInfo->GetReg(), regThis,
+ getEmitter()->emitIns_R_R_I(INS_add, EA_BYREF, compiler->virtualStubParamInfo->GetReg(), regThis,
pInfo->offsetOfSecureDelegateIndirectCell);
regTracker.rsTrackRegTrash(compiler->virtualStubParamInfo->GetReg());
+
+ // Ensure that the virtual stub param info register doesn't get reused before the call is taken
+ regSet.rsLockReg(compiler->virtualStubParamInfo->GetRegMask(), ®sUsed);
}
+
#endif // _TARGET_ARM_
// Grab an available register to use for the CALL indirection
INDEBUG_LDISASM_COMMA(sigInfo) NULL, // addr
args, retSize, gcInfo.gcVarPtrSetCur, gcInfo.gcRegGCrefSetCur,
gcInfo.gcRegByrefSetCur, ilOffset, indCallReg);
+
+#ifdef _TARGET_ARM_
+ if ((call->gtCallMoreFlags & GTF_CALL_M_SECURE_DELEGATE_INV))
+ {
+ regSet.rsUnlockReg(compiler->virtualStubParamInfo->GetRegMask(), regsUsed);
+ }
+#endif // _TARGET_ARM_
}
else