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

Add support for R2R ldvirtftn helpers #8608

Merged
merged 1 commit into from
Dec 14, 2016
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
22 changes: 17 additions & 5 deletions src/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4934,14 +4934,26 @@ GenTreePtr Compiler::impImportLdvirtftn(GenTreePtr thisPtr,
}

#ifdef FEATURE_READYTORUN_COMPILER
if (opts.IsReadyToRun() && !pCallInfo->exactContextNeedsRuntimeLookup)
if (opts.IsReadyToRun())
{
GenTreeCall* call = gtNewHelperCallNode(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR, TYP_I_IMPL, GTF_EXCEPT,
gtNewArgList(thisPtr));
if (!pCallInfo->exactContextNeedsRuntimeLookup)
{
GenTreeCall* call = gtNewHelperCallNode(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR, TYP_I_IMPL, GTF_EXCEPT,
gtNewArgList(thisPtr));

call->setEntryPoint(pCallInfo->codePointerLookup.constLookup);
call->setEntryPoint(pCallInfo->codePointerLookup.constLookup);

return call;
return call;
}

// We need a runtime lookup. CoreRT has a ReadyToRun helper for that too.
if (IsTargetAbi(CORINFO_CORERT_ABI))
{
GenTreePtr ctxTree = getRuntimeContextTree(pCallInfo->codePointerLookup.lookupKind.runtimeLookupKind);

return impReadyToRunHelperToTree(pResolvedToken, CORINFO_HELP_READYTORUN_GENERIC_HANDLE, TYP_I_IMPL,
gtNewArgList(ctxTree), &pCallInfo->codePointerLookup.lookupKind);
}
}
#endif

Expand Down