diff options
author | Michal Strehovský <MichalStrehovsky@users.noreply.github.com> | 2016-12-14 10:03:53 -0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-12-14 10:03:53 -0800 |
commit | deb75b4f815fd4d86ad444d19eec50f0f869f994 (patch) | |
tree | 1719e8fdad50e87df19df80d125f2c454ce8f433 /src/jit | |
parent | 3a8ebe8cefd0e2e7e14c544bcce687bf87fc7de9 (diff) | |
download | coreclr-deb75b4f815fd4d86ad444d19eec50f0f869f994.tar.gz coreclr-deb75b4f815fd4d86ad444d19eec50f0f869f994.tar.bz2 coreclr-deb75b4f815fd4d86ad444d19eec50f0f869f994.zip |
Add support for R2R ldvirtftn helpers (#8608)
The codegen for the non-readytorun path (used on CoreCLR) requires the
runtime to support general purpose virtual method resolution based on a
method handle. CoreRT doesn't have such helpers.
Diffstat (limited to 'src/jit')
-rw-r--r-- | src/jit/importer.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 620ba14ebb..cb09ff8b8c 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -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 |