diff options
author | Yi Zhang (CLR) <yizhang82@users.noreply.github.com> | 2017-04-05 21:04:25 -0700 |
---|---|---|
committer | Yi Zhang (CLR) <yzha@microsoft.com> | 2017-07-19 11:16:55 -0700 |
commit | dcf60f83a0557b3c2fbb705a4fdb3bade0e14854 (patch) | |
tree | ab25f5065a1777493e6da4d6330aa873bb8908e0 /src/vm/classcompat.cpp | |
parent | 8a163ca04ae8734f4a9ee51e470beda933c96333 (diff) | |
download | coreclr-dcf60f83a0557b3c2fbb705a4fdb3bade0e14854.tar.gz coreclr-dcf60f83a0557b3c2fbb705a4fdb3bade0e14854.tar.bz2 coreclr-dcf60f83a0557b3c2fbb705a4fdb3bade0e14854.zip |
Default Interface Method Prototype (#10505)
* allow non-zero RVA on abstract interface method in ilasm
* Revert "allow non-zero RVA on abstract interface method in ilasm"
This reverts commit eecb8024e58f14a20e5e49359f38019f5768ac41.
* add a test case and allow virtual non-abstract method in ilasm
* allow non-abstract methods in the loader
* fixup dispatch map
* support for simple default interface method scenario
* fix a bug with incorrect usage of MethodIterator skpping the first method. add a test case for overriding but it may not be what we want
* add another simple test case for base class
* allow private/internal methods in ilasm and add a explict impl test
* update reference to mscorlib in il test
* add shared generics and variance case
* allow interface dispatch to return instantiating stubs with the right PARAM_TYPE calling conv
* simple factoring and add a valuetype test case
* add a test case for generic virtual methods
* a bit more refactoring by moving the CALLCONV_PARAMTYPE logic inside getMethodSigInternal
* support explicit methodimpl and remove implicit methodimpl test case
* update test cases to give more clear output
* Fix a bug where GetMethodDescForSlot chokes on interface MethodDesc without precode. This is accdentally discovered by methodimpl test case when iterating methods on a default interface method that has already been JITted
* cleanup code after review and add a bit more comments
* update comments
* only use custom ILAsm for default interface methods tests - some tests are choking on CoreCLR ilasm for security related stuff
* address comments and allow instance methods, and add a constraint value type call test scenario
* disable the failing protected method scenario
Diffstat (limited to 'src/vm/classcompat.cpp')
-rw-r--r-- | src/vm/classcompat.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/src/vm/classcompat.cpp b/src/vm/classcompat.cpp index 91004cdbc7..031604bc8e 100644 --- a/src/vm/classcompat.cpp +++ b/src/vm/classcompat.cpp @@ -2619,26 +2619,6 @@ VOID MethodTableBuilder::EnumerateClassMethods() } } - // Some interface checks. - if (IsInterface()) - { - if (IsMdVirtual(dwMemberAttrs)) - { - if (!IsMdAbstract(dwMemberAttrs)) - { - BuildMethodTableThrowException(BFA_VIRTUAL_NONAB_INT_METHOD); - } - } - else - { - // Instance field/method - if (!IsMdStatic(dwMemberAttrs)) - { - BuildMethodTableThrowException(BFA_NONVIRT_INST_INT_METHOD); - } - } - } - // No synchronized methods in ValueTypes if(fIsClassValueType && IsMiSynchronized(dwImplFlags)) { @@ -2804,17 +2784,20 @@ VOID MethodTableBuilder::EnumerateClassMethods() // If the interface is a standard managed interface then allocate space for an FCall method desc. Classification = mcFCall; } - else + else if (IsMdAbstract(dwMemberAttrs)) { // If COM interop is supported then all other interface MDs may be // accessed via COM interop <TODO> mcComInterop MDs are BIG - // this is very often a waste of space </TODO> + // @DIM_TODO - What if default interface method is called through COM interop? Classification = mcComInterop; } -#else // !FEATURE_COMINTEROP - // This codepath is used by remoting - Classification = mcIL; + else #endif // !FEATURE_COMINTEROP + { + // This codepath is used by remoting and default interface methods + Classification = mcIL; + } } else { |