diff options
author | Andon Andonov <anandono@microsoft.com> | 2018-03-08 21:47:19 +0100 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-03-08 12:47:19 -0800 |
commit | 0c428892ab569d17a8a2366d06e9900842d857cb (patch) | |
tree | 48fdd61ec63a67e4571872e58ecf56bfc669a2cd /src/vm/method.cpp | |
parent | 61fadb4d01e5d2c5c732160dc5e42ebe2a7c0858 (diff) | |
download | coreclr-0c428892ab569d17a8a2366d06e9900842d857cb.tar.gz coreclr-0c428892ab569d17a8a2366d06e9900842d857cb.tar.bz2 coreclr-0c428892ab569d17a8a2366d06e9900842d857cb.zip |
Pass generic context argument for shared instance methods on generic interfaces (#16690)
* Add checks and regression test
* Uncomment InvokeConsumer tests
* Revert JIT Interface Check
Diffstat (limited to 'src/vm/method.cpp')
-rw-r--r-- | src/vm/method.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vm/method.cpp b/src/vm/method.cpp index 8778744537..9b3080ec6c 100644 --- a/src/vm/method.cpp +++ b/src/vm/method.cpp @@ -1639,7 +1639,7 @@ BOOL MethodDesc::IsSharedByGenericMethodInstantiations() // - there is no this pointer providing generic dictionary info // * shared-code instance methods in instantiated generic structs (e.g. void MyValueType<string>::m()) // - unboxed 'this' pointer in value-type instance methods don't have MethodTable pointer by definition -// * default interface method called via interface dispatch (e. g. IFoo<string>.Foo calling into IFoo<object>::Foo()) +// * shared instance and default interface methods called via interface dispatch (e. g. IFoo<string>.Foo calling into IFoo<object>::Foo()) // - this pointer is ambiguous as it can implement more than one IFoo<T> BOOL MethodDesc::RequiresInstMethodTableArg() { @@ -1648,7 +1648,8 @@ BOOL MethodDesc::RequiresInstMethodTableArg() return IsSharedByGenericInstantiations() && !HasMethodInstantiation() && - (IsStatic() || GetMethodTable()->IsValueType() || IsDefaultInterfaceMethod()); + (IsStatic() || GetMethodTable()->IsValueType() || (GetMethodTable()->IsInterface() && !IsAbstract())); + } //******************************************************************************* @@ -1670,7 +1671,7 @@ BOOL MethodDesc::RequiresInstArg() LIMITED_METHOD_DAC_CONTRACT; BOOL fRet = IsSharedByGenericInstantiations() && - (HasMethodInstantiation() || IsStatic() || GetMethodTable()->IsValueType() || IsDefaultInterfaceMethod()); + (HasMethodInstantiation() || IsStatic() || GetMethodTable()->IsValueType() || (GetMethodTable()->IsInterface() && !IsAbstract())); _ASSERT(fRet == (RequiresInstMethodTableArg() || RequiresInstMethodDescArg())); return fRet; @@ -1747,7 +1748,7 @@ BOOL MethodDesc::AcquiresInstMethodTableFromThis() { !HasMethodInstantiation() && !IsStatic() && !GetMethodTable()->IsValueType() && - !IsDefaultInterfaceMethod(); + !(GetMethodTable()->IsInterface() && !IsAbstract()); } //******************************************************************************* |