summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2018-01-24 01:10:52 +0100
committerJan Kotas <jkotas@microsoft.com>2018-01-23 16:10:52 -0800
commit3211c255a54b2956b345ba85e7be371548264e7a (patch)
tree09619a0fe1b41e174f52cdb57acfc6061c8815d2
parent2dbcd446269df79a49bfb3e1222fccdb22db27ef (diff)
downloadcoreclr-3211c255a54b2956b345ba85e7be371548264e7a.tar.gz
coreclr-3211c255a54b2956b345ba85e7be371548264e7a.tar.bz2
coreclr-3211c255a54b2956b345ba85e7be371548264e7a.zip
Do not devirtualize shared default interface methods (#15979)
The result of the devirtualization for a method on a generic type should be an instantiating stub, but this doesn't seem to work right. Fixing that is a perf issue (that can be triaged/punted - #15977). This commit is a correctness fix to avoid bad codegen for that case. Resolves #15591.
-rw-r--r--src/vm/jitinterface.cpp8
-rw-r--r--tests/issues.targets3
-rw-r--r--tests/testsFailingOutsideWindows.txt1
3 files changed, 8 insertions, 4 deletions
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 874beae85b..d08ba0cbe2 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -8870,6 +8870,14 @@ CORINFO_METHOD_HANDLE CEEInfo::resolveVirtualMethodHelper(CORINFO_METHOD_HANDLE
{
return nullptr;
}
+
+ // If we devirtualized into a default interface method on a generic type, we should actually return an
+ // instantiating stub but this is not happening.
+ // Making this work is tracked by https://github.com/dotnet/coreclr/issues/15977
+ if (pDevirtMD->GetMethodTable()->IsInterface() && pDevirtMD->HasClassInstantiation())
+ {
+ return nullptr;
+ }
}
else
{
diff --git a/tests/issues.targets b/tests/issues.targets
index 67367004b6..1ebf4cd8b8 100644
--- a/tests/issues.targets
+++ b/tests/issues.targets
@@ -169,9 +169,6 @@
<ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\DefaultInterfaceMethods\diamondshape\diamondshape\*">
<Issue>15591</Issue>
</ExcludeList>
- <ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\DefaultInterfaceMethods\sharedgenerics\sharedgenerics\*">
- <Issue>15591</Issue>
- </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)\Loader\classloader\DefaultInterfaceMethods\constrainedcall\constrainedcall\*">
<Issue>15353</Issue>
</ExcludeList>
diff --git a/tests/testsFailingOutsideWindows.txt b/tests/testsFailingOutsideWindows.txt
index 47acd428e7..4a10b2f998 100644
--- a/tests/testsFailingOutsideWindows.txt
+++ b/tests/testsFailingOutsideWindows.txt
@@ -72,7 +72,6 @@ GC/Features/LOHFragmentation/lohfragmentation/lohfragmentation.sh
GC/Features/SustainedLowLatency/scenario/scenario.sh
GC/Regressions/dev10bugs/536168/536168/536168.sh
Loader/classloader/DefaultInterfaceMethods/diamondshape/diamondshape/diamondshape.sh
-Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics/sharedgenerics.sh
Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall/constrainedcall.sh
Loader/classloader/TypeGeneratorTests/TypeGeneratorTest612/Generated612/Generated612.sh
Loader/classloader/TypeGeneratorTests/TypeGeneratorTest613/Generated613/Generated613.sh