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

Commit 405eb72

Browse files
committed
Merge pull request #3059 from jkotas/intrinsics
Improve robustness of intrinsic fallback path
2 parents eb1e835 + caffa7b commit 405eb72

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/jit/importer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5823,7 +5823,7 @@ var_types Compiler::impImportCall (OPCODE opcode,
58235823
{
58245824
if (opts.IsReadyToRun())
58255825
{
5826-
assert(callInfo->kind == CORINFO_CALL);
5826+
noway_assert(callInfo->kind == CORINFO_CALL);
58275827
call->gtIntrinsic.gtEntryPoint = callInfo->codePointerLookup.constLookup;
58285828
}
58295829
else

src/vm/jitinterface.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5568,8 +5568,10 @@ void CEEInfo::getCallInfo(
55685568
// Note that it is safe to devirtualize in the following cases, since a servicing event cannot later modify it
55695569
// 1) Callvirt on a virtual final method of a value type - since value types are sealed types as per ECMA spec
55705570
// 2) Delegate.Invoke() - since a Delegate is a sealed class as per ECMA spec
5571+
// 3) JIT intrinsics - since they have pre-defined behavior
55715572
devirt = pTargetMD->GetMethodTable()->IsValueType() ||
5572-
(pTargetMD->GetMethodTable()->IsDelegate() && ((DelegateEEClass*)(pTargetMD->GetMethodTable()->GetClass()))->m_pInvokeMethod == pMD);
5573+
(pTargetMD->GetMethodTable()->IsDelegate() && ((DelegateEEClass*)(pTargetMD->GetMethodTable()->GetClass()))->m_pInvokeMethod == pMD) ||
5574+
(pTargetMD->IsFCall() && ECall::GetIntrinsicID(pTargetMD) != CORINFO_INTRINSIC_Illegal);
55735575

55745576
callVirtCrossingVersionBubble = true;
55755577
}

0 commit comments

Comments
 (0)