From bbc5ef761a5e2bf8437531119f1a3a942cca915f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Strehovsk=C3=BD?= Date: Sun, 9 Jul 2017 00:31:30 -0400 Subject: [PATCH] Use R2R helper for runtime lookups only when USEHELPER was specified (dotnet/coreclr#12669) The CoreRT compiler would like to be able to do indirections-based lookup even when ReadyToRun codegen is specified. Commit migrated from https://github.com/dotnet/coreclr/commit/29de0696d2e870a891c7312316620083f953604e --- src/coreclr/src/jit/importer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp index fc88e1c..b618478 100644 --- a/src/coreclr/src/jit/importer.cpp +++ b/src/coreclr/src/jit/importer.cpp @@ -1947,18 +1947,18 @@ GenTreePtr Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedTok GenTreePtr ctxTree = getRuntimeContextTree(pLookup->lookupKind.runtimeLookupKind); -#ifdef FEATURE_READYTORUN_COMPILER - if (opts.IsReadyToRun()) - { - return impReadyToRunHelperToTree(pResolvedToken, CORINFO_HELP_READYTORUN_GENERIC_HANDLE, TYP_I_IMPL, - gtNewArgList(ctxTree), &pLookup->lookupKind); - } -#endif - CORINFO_RUNTIME_LOOKUP* pRuntimeLookup = &pLookup->runtimeLookup; // It's available only via the run-time helper function if (pRuntimeLookup->indirections == CORINFO_USEHELPER) { +#ifdef FEATURE_READYTORUN_COMPILER + if (opts.IsReadyToRun()) + { + return impReadyToRunHelperToTree(pResolvedToken, CORINFO_HELP_READYTORUN_GENERIC_HANDLE, TYP_I_IMPL, + gtNewArgList(ctxTree), &pLookup->lookupKind); + } +#endif + GenTreeArgList* helperArgs = gtNewArgList(ctxTree, gtNewIconEmbHndNode(pRuntimeLookup->signature, nullptr, GTF_ICON_TOKEN_HDL, 0, nullptr, compileTimeHandle)); -- 2.7.4