Default Interface Method Prototype (#10505)
authorYi Zhang (CLR) <yizhang82@users.noreply.github.com>
Thu, 6 Apr 2017 04:04:25 +0000 (21:04 -0700)
committerYi Zhang (CLR) <yzha@microsoft.com>
Wed, 19 Jul 2017 18:16:55 +0000 (11:16 -0700)
commitdcf60f83a0557b3c2fbb705a4fdb3bade0e14854
treeab25f5065a1777493e6da4d6330aa873bb8908e0
parent8a163ca04ae8734f4a9ee51e470beda933c96333
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
30 files changed:
src/ilasm/assem.cpp
src/ilasm/assembler.cpp
src/vm/classcompat.cpp
src/vm/jitinterface.cpp
src/vm/jitinterface.h
src/vm/method.cpp
src/vm/method.hpp
src/vm/methodtable.cpp
src/vm/methodtable.h
src/vm/methodtable.inl
src/vm/methodtablebuilder.cpp
tests/src/IL.targets
tests/src/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.cs [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.il [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/constrainedcall/constrainedcall.ilproj [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/genericmethods/genericmethods.cs [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/genericmethods/genericmethods.il [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/genericmethods/genericmethods.ilproj [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/methodimpl/methodimpl.cs [new file with mode: 0755]
tests/src/Loader/classloader/DefaultInterfaceMethods/methodimpl/methodimpl.il [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/methodimpl/methodimpl.ilproj [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics.cs [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics.il [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/sharedgenerics/sharedgenerics.ilproj [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/simple/simple.cs [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/simple/simple.il [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/simple/simple.ilproj [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/valuetypes/valuetypes.cs [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/valuetypes/valuetypes.il [new file with mode: 0644]
tests/src/Loader/classloader/DefaultInterfaceMethods/valuetypes/valuetypes.ilproj [new file with mode: 0644]