From: Michal Strehovský Date: Sun, 9 Jul 2017 04:31:30 +0000 (-0400) Subject: Use R2R helper for runtime lookups only when USEHELPER was specified (dotnet/coreclr... X-Git-Tag: submit/tizen/20210909.063632~11030^2~6925^2~233 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbc5ef761a5e2bf8437531119f1a3a942cca915f;p=platform%2Fupstream%2Fdotnet%2Fruntime.git 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 --- 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));