summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Ayers <andya@microsoft.com>2017-03-16 08:30:58 -0700
committerAndy Ayers <andya@microsoft.com>2017-03-16 13:51:37 -0700
commit2c8b3ae4c1786968f387af9c78a343e0a561869b (patch)
treed0a3b4b48566b0f945bd11f2e056010211dc649a
parent00f13f2fb04c21fc1675ce264ef7291cbcec67a1 (diff)
downloadcoreclr-2c8b3ae4c1786968f387af9c78a343e0a561869b.tar.gz
coreclr-2c8b3ae4c1786968f387af9c78a343e0a561869b.tar.bz2
coreclr-2c8b3ae4c1786968f387af9c78a343e0a561869b.zip
Interface call devirtualization: jit side of changes
Unblock VM queries where the base class is an interface (queries where the implementing class is also an interface are still blocked as no resolution is possible). Pass along the context handle that the jit got from getCallInfo.
-rw-r--r--src/jit/importer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp
index e285fed5ae..9d1daac04b 100644
--- a/src/jit/importer.cpp
+++ b/src/jit/importer.cpp
@@ -18488,16 +18488,15 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call,
return;
}
- // Bail (for now) if base class is an interface.
if (isInterface)
{
assert(call->IsVirtualStub());
- JITDUMP("--- base class is interface, sorry\n");
- return;
+ JITDUMP("--- base class is interface\n");
}
// Fetch the method that would be called based on the declared type of 'this'
- CORINFO_METHOD_HANDLE derivedMethod = info.compCompHnd->resolveVirtualMethod(baseMethod, objClass);
+ CORINFO_CONTEXT_HANDLE ownerType = callInfo->contextHandle;
+ CORINFO_METHOD_HANDLE derivedMethod = info.compCompHnd->resolveVirtualMethod(baseMethod, objClass, ownerType);
// If we failed to get a handle, we can't devirtualize. This can
// happen when prejitting, if the devirtualization crosses