Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Merge dev/defaultintf to master#15370

Merged
MichalStrehovsky merged 48 commits intodotnet:masterfrom
MichalStrehovsky:defaultintf-merge
Dec 15, 2017
Merged

Merge dev/defaultintf to master#15370
MichalStrehovsky merged 48 commits intodotnet:masterfrom
MichalStrehovsky:defaultintf-merge

Conversation

@MichalStrehovsky
Copy link
Copy Markdown
Member

@MichalStrehovsky MichalStrehovsky commented Dec 5, 2017

Marking as WIP because I would like to:

  • Run all the tests on this
  • Review the changes coming in with people who know about the affected parts of the codebase
  • See if we need to put more code under FEATURE_DEFAULT_INTERFACES
  • Figure out how we want to merge this (are we okay with the individual commits or do we want to do some rebasing?)

yizhang82 and others added 30 commits July 19, 2017 11:16
* allow non-zero RVA on abstract interface method in ilasm

* Revert "allow non-zero RVA on abstract interface method in ilasm"

This reverts commit eecb802.

* 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
* Support protected methods
* add a test for diamond shape scenario and tentatively throw exception when that happens
* Support non-virtual calls on interface private members correctly
* Support protected methods
* Properly handle precode
* Throw (tentative) exception when seeing conflict overrides and add a test case

(This updates CoreCLR dev/defaultintf the same with the build we are showing at //build)
Updating the PreReleaseLabel name so we get official Default Interface's builds.
This will fix errors like "E:\A\_work\0\a\MicroBuild\Plugins\MicroBuild.Plugins.Signing.1.0.321\build\MicroBuild.Plugins.Signing.targets(0,0): error : File E:\A\_work\0\b\pipelineRepository\bin\obj\SymbolsCatalog\9\signatures.cat is not in one of the expected output locations and cannot be signed. [E:\A\_work\0\b\pipelineRepository\build.proj]" being tracked by https://github.com/dotnet/core-eng/issues/1173
This value was changed back after a rebase to master was done
* Update dependencies and use live/packaged ilasm

* Fix ilasm excessive stack usage when deleting lots of generic parameters
* first cut of multiple candidates

* new positive case for diamond shape
* Add proper missing implementation detection and positive diamond shape scenario support. Untested

* fix bug and get test to pass

* Add more diamond shape pos/neg tests

* Fix bad I8

* Add GVM tests to diamond shape

* GVM working

* Change test case to better match diamondshape scenario

* Fix MethodImpl::Iterator::GetMethodDesc and optimize no-method impl scenario

* Update methodimpl test to include multiple slots and fix a bug

* Temporarily disable incremental build in this branch

* Update methodimpl to include multiple methodipml overriding scenario. This is triggering some bugs and need to investigate

* Fix a buffer overrrun bug with interface methodimpl

* Update after self-review

* Add proper methodImpl validation for methods

* Address feedback. Refactoring pending
Update to latest changes from master branch
…ster

Actually merge to completely up to date with master
@MichalStrehovsky
Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT x64 corefx_baseline
@dotnet-bot test Ubuntu x64 corefx_baseline

@MichalStrehovsky
Copy link
Copy Markdown
Member Author

Cc @sergiy-k

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Dec 5, 2017

@dotnet-bot test Windows_NT x64 Checked corefx_baseline
@dotnet-bot test Ubuntu x64 Checked corefx_baseline

@MichalStrehovsky
Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT x64 Checked corefx_baseline

@MichalStrehovsky
Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT x64 Checked corefx_baseline

We ran out of disk space. Cc @dotnet/dnceng

@jcagme
Copy link
Copy Markdown

jcagme commented Dec 6, 2017

/cc: @mmitche

@mmitche
Copy link
Copy Markdown
Member

mmitche commented Dec 6, 2017

@MattGal This was that machine I was referring to. We should check to see whether we can figure out what is taking up so much space, and whether the machine has been around a long time.

@MichalStrehovsky
Copy link
Copy Markdown
Member Author

OK, the Windows_NT x64 Checked Build and Test (Jit - CoreFx) failure is also present in the baseline (see #15391). The tests can be considered green.

Comment thread clrdefinitions.cmake

# If set, indicates that this is not an officially supported release
# Keep in sync with IsPrerelease in dir.props
set(PRERELEASE 1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this is hard coded to 1. Shouldn't this be controlled by an environment variable or something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want this to be always enabled in development branches and always disabled in release branches. Unfortunately, we couldn't find any other way. Environment variables wouldn't satisfy that requirement.

Copy link
Copy Markdown
Member

@davidwrighton davidwrighton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, this looks ok, although I have a few comments regarding making the disabling of the the feature more comprehensive. Also, as the change is large and potentially impactful, its difficult to review for correctness, and I'm assuming we're running as much of a test suite as we can manage.

Comment thread src/vm/method.hpp
inline BOOL IsDefaultInterfaceMethod()
{
LIMITED_METHOD_CONTRACT;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the #if for default interfaces isn't enabled, this should just return false.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment thread src/vm/methodtable.cpp
MethodDesc **ppDefaultMethod
)
{
CONTRACT(BOOL) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the default interface #if isn't enabled, this function should return false, and fail to find anything.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment thread src/vm/methodtable.cpp Outdated
MethodTable::InterfaceMapIterator it = pCanonMT->IterateInterfaceMap();
DWORD cPotentialMatchingInterfaces = 0;
while (it.Next())
// chance of this happening by checking for all interfaces which might possibly
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to indenting here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment thread src/vm/methodtablebuilder.cpp Outdated
}
}
else if(fIsClassInterface)
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code has a lot of trailing spaces, please fix.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


// Returns true if there is at least one default implementation for this interface method
// We don't care about conflicts at this stage in order to avoid impact type load performance
BOOL MethodTableBuilder::HasDefaultInterfaceImplementation(MethodDesc *pDeclMD)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HasDefaultInterfaceImplementation [](start = 25, length = 33)

This should also return false if the default interface #if is not enabled

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Copy Markdown

@fadimounir fadimounir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@MichalStrehovsky
Copy link
Copy Markdown
Member Author

@jkotas Do you have an opinion on whether we should just squash and merge or make a merge commit, or try to rebase something?

(I'm not too keen on the rebasing because there was a ton of merge conflicts in the auto-update dependencies files that I would rather not have to resolve again.)

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Dec 13, 2017

I would make a merge commit.

Copy link
Copy Markdown

@fadimounir fadimounir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@MichalStrehovsky MichalStrehovsky changed the title [WIP] Merge dev/defaultintf to master Merge dev/defaultintf to master Dec 15, 2017
@MichalStrehovsky MichalStrehovsky merged commit 1a4a2d5 into dotnet:master Dec 15, 2017
@MichalStrehovsky MichalStrehovsky deleted the defaultintf-merge branch December 15, 2017 10:52
dotnet-bot pushed a commit to dotnet/corert that referenced this pull request Dec 15, 2017
…intf-merge

Merge dev/defaultintf to master

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
jkotas pushed a commit to dotnet/corert that referenced this pull request Dec 15, 2017
…intf-merge

Merge dev/defaultintf to master

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
@BruceForstall
Copy link
Copy Markdown

@MichalStrehovsky It looks like this change has broken all release builds with these test failures:

Loader_classloader._DefaultInterfaceMethods_sharedgenerics_sharedgenerics_sharedgenerics_._DefaultInterfaceMethods_sharedgenerics_sharedgenerics_sharedgenerics_cmd
Loader_classloader._DefaultInterfaceMethods_diamondshape_diamondshape_diamondshape_._DefaultInterfaceMethods_diamondshape_diamondshape_diamondshape_cmd

e.g.:
https://ci.dot.net/job/dotnet_coreclr/job/master/job/release_windows_nt/
https://ci.dot.net/job/dotnet_coreclr/job/master/job/x86_release_windows_nt/

@MichalStrehovsky
Copy link
Copy Markdown
Member Author

@BruceForstall Sigh, thanks for bringing it to my attention! Those are new tests that came with the feature, so not a huge concern - it means there will be more bugs to deal with, I guess. I'll file an issue and block them on it.

dotnet-bot pushed a commit to dotnet/corefx that referenced this pull request Jan 13, 2018
…intf-merge

Merge dev/defaultintf to master

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
dotnet-bot pushed a commit to dotnet/corefx that referenced this pull request Jan 13, 2018
…intf-merge

Merge dev/defaultintf to master

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
safern pushed a commit to dotnet/corefx that referenced this pull request Jan 16, 2018
…intf-merge

Merge dev/defaultintf to master

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
safern pushed a commit to dotnet/corefx that referenced this pull request Jan 16, 2018
…intf-merge

Merge dev/defaultintf to master

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.