summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2016-10-26 19:57:41 -0700
committerGitHub <noreply@github.com>2016-10-26 19:57:41 -0700
commit22303a95a5320c4a339fe36c21ffaa9e59ffb08f (patch)
tree645ea5b984e583d4b6e3bc18a2418f97ed0a046e
parent63a2b04a06374438f4837334fde030bb5d25f524 (diff)
downloadcoreclr-22303a95a5320c4a339fe36c21ffaa9e59ffb08f.tar.gz
coreclr-22303a95a5320c4a339fe36c21ffaa9e59ffb08f.tar.bz2
coreclr-22303a95a5320c4a339fe36c21ffaa9e59ffb08f.zip
Use getLocationOfThisType instead of embedGenericHandle (#7813)
getLocationOfThisType does way less work and gives the same result (the part we care about).
-rw-r--r--src/jit/compiler.h2
-rw-r--r--src/jit/importer.cpp16
2 files changed, 8 insertions, 10 deletions
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index 0f9618d85f..2f51c01fe5 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -2912,7 +2912,7 @@ public:
unsigned flags,
void* compileTimeHandle);
- GenTreePtr getRuntimeContextTree(CORINFO_LOOKUP* pLookup);
+ GenTreePtr getRuntimeContextTree(CORINFO_RUNTIME_LOOKUP_KIND kind);
GenTreePtr impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedToken,
CORINFO_LOOKUP* pLookup,
diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp
index 61906b2f12..742d998f3a 100644
--- a/src/jit/importer.cpp
+++ b/src/jit/importer.cpp
@@ -1872,7 +1872,7 @@ GenTreePtr Compiler::impMethodPointer(CORINFO_RESOLVED_TOKEN* pResolvedToken, CO
// getRuntimeContextTree: find pointer to context for runtime lookup.
//
// Arguments:
-// pLookup - how to do lookup.
+// kind - lookup kind.
//
// Return Value:
// Return GenTree pointer to generic shared context.
@@ -1880,10 +1880,9 @@ GenTreePtr Compiler::impMethodPointer(CORINFO_RESOLVED_TOKEN* pResolvedToken, CO
// Notes:
// Reports about generic context using.
-GenTreePtr Compiler::getRuntimeContextTree(CORINFO_LOOKUP* pLookup)
+GenTreePtr Compiler::getRuntimeContextTree(CORINFO_RUNTIME_LOOKUP_KIND kind)
{
- GenTreePtr ctxTree = nullptr;
- CORINFO_RUNTIME_LOOKUP_KIND kind = pLookup->lookupKind.runtimeLookupKind;
+ GenTreePtr ctxTree = nullptr;
// Collectible types requires that for shared generic code, if we use the generic context parameter
// that we report it. (This is a conservative approach, we could detect some cases particularly when the
@@ -1936,7 +1935,7 @@ GenTreePtr Compiler::impRuntimeLookupToTree(CORINFO_RESOLVED_TOKEN* pResolvedTok
// In other word, it cannot be called by the instance of the Compiler for the inlinee.
assert(!compIsForInlining());
- GenTreePtr ctxTree = getRuntimeContextTree(pLookup);
+ GenTreePtr ctxTree = getRuntimeContextTree(pLookup->lookupKind.runtimeLookupKind);
#ifdef FEATURE_READYTORUN_COMPILER
if (opts.IsReadyToRun())
@@ -5794,11 +5793,10 @@ GenTreePtr Compiler::impImportStaticFieldAccess(CORINFO_RESOLVED_TOKEN* pResolve
{
#ifdef FEATURE_READYTORUN_COMPILER
noway_assert(opts.IsReadyToRun());
- CORINFO_GENERICHANDLE_RESULT embedInfo;
- info.compCompHnd->embedGenericHandle(pResolvedToken, FALSE, &embedInfo);
- assert(embedInfo.lookup.lookupKind.needsRuntimeLookup);
+ CORINFO_LOOKUP_KIND kind = info.compCompHnd->getLocationOfThisType(info.compMethodHnd);
+ assert(kind.needsRuntimeLookup);
- GenTreePtr ctxTree = getRuntimeContextTree(&embedInfo.lookup);
+ GenTreePtr ctxTree = getRuntimeContextTree(kind.runtimeLookupKind);
GenTreeArgList* args = gtNewArgList(ctxTree);
unsigned callFlags = 0;