{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corert/pulls/comments/81459297","pull_request_review_id":2439682,"id":81459297,"diff_hunk":"@@ -79,7 +79,7 @@ public static bool RequiresInstMethodTableArg(this MethodDesc method)\n         /// </summary>\n         public static bool AcquiresInstMethodTableFromThis(this MethodDesc method)\n         {\n-            return method.IsSharedByGenericInstantiations &&\n+            return method.IsCanonicalMethod(CanonicalFormKind.Any) &&","path":"src/ILCompiler.Compiler/src/Compiler/TypeExtensions.cs","position":32,"original_position":32,"commit_id":"5a831a89143717424be3bed864845ad96ce973fb","original_commit_id":"5a831a89143717424be3bed864845ad96ce973fb","user":{"login":"MichalStrehovsky","id":13110571,"avatar_url":"https://avatars.githubusercontent.com/u/13110571?v=3","gravatar_id":"","url":"https://api.github.com/users/MichalStrehovsky","html_url":"https://github.com/MichalStrehovsky","followers_url":"https://api.github.com/users/MichalStrehovsky/followers","following_url":"https://api.github.com/users/MichalStrehovsky/following{/other_user}","gists_url":"https://api.github.com/users/MichalStrehovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/MichalStrehovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichalStrehovsky/subscriptions","organizations_url":"https://api.github.com/users/MichalStrehovsky/orgs","repos_url":"https://api.github.com/users/MichalStrehovsky/repos","events_url":"https://api.github.com/users/MichalStrehovsky/events{/privacy}","received_events_url":"https://api.github.com/users/MichalStrehovsky/received_events","type":"User","site_admin":false},"body":"I eagerly stole `IsSharedByGenericInstantiations` from NUTC, but it might be something specific to the UTC inliner. It means: is the method (or the owning type) instantiated over canonical types (either a __Canon, or a struct instantiated over __Canon).\r\n\r\nIn particular `IsSharedByGenericInstantiations` will say false on, say, `Foo<System.__Canon[]>` which does show up sometimes on the JitInterface side before it gets normalized. Alternative approach would be to be very careful about when things are normalized or aren't.","created_at":"2016-10-01T21:54:37Z","updated_at":"2016-10-01T21:54:37Z","html_url":"https://github.com/dotnet/corert/pull/1969#discussion_r81459297","pull_request_url":"https://api.github.com/repos/dotnet/corert/pulls/1969","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corert/pulls/comments/81459297"},"html":{"href":"https://github.com/dotnet/corert/pull/1969#discussion_r81459297"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corert/pulls/1969"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corert/pulls/1969","id":87615557,"html_url":"https://github.com/dotnet/corert/pull/1969","diff_url":"https://github.com/dotnet/corert/pull/1969.diff","patch_url":"https://github.com/dotnet/corert/pull/1969.patch","issue_url":"https://api.github.com/repos/dotnet/corert/issues/1969","number":1969,"state":"open","locked":false,"title":"Tracking of canonical method dependencies","user":{"login":"MichalStrehovsky","id":13110571,"avatar_url":"https://avatars.githubusercontent.com/u/13110571?v=3","gravatar_id":"","url":"https://api.github.com/users/MichalStrehovsky","html_url":"https://github.com/MichalStrehovsky","followers_url":"https://api.github.com/users/MichalStrehovsky/followers","following_url":"https://api.github.com/users/MichalStrehovsky/following{/other_user}","gists_url":"https://api.github.com/users/MichalStrehovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/MichalStrehovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichalStrehovsky/subscriptions","organizations_url":"https://api.github.com/users/MichalStrehovsky/orgs","repos_url":"https://api.github.com/users/MichalStrehovsky/repos","events_url":"https://api.github.com/users/MichalStrehovsky/events{/privacy}","received_events_url":"https://api.github.com/users/MichalStrehovsky/received_events","type":"User","site_admin":false},"body":"This is continuation of shared generic work. After this is in, we can compile the following with shared generics enabled:\r\n\r\n```csharp\r\nclass Foo\r\n{\r\n    static object Gen1<T>()\r\n    {\r\n        return MakeArray<ClassGen<T>>();\r\n    }\r\n\r\n    static object MakeArray<T>()\r\n    {\r\n        return new T[0];\r\n    }\r\n\r\n    class Gen<T>\r\n    {\r\n        public object _field;\r\n\r\n        public object Frob()\r\n        {\r\n            _field = new ValueGen<T[]>();\r\n            return _field;\r\n        }\r\n\r\n        public object Futz()\r\n        {\r\n            return Gen1<ValueGen<T>>();\r\n        }\r\n    }\r\n\r\n    struct ValueGen<T>\r\n    {\r\n    }\r\n\r\n    class ClassGen<T>\r\n    {\r\n    }\r\n\r\n    static int Main()\r\n    {\r\n        new Gen<string>().Frob();\r\n        new Gen<object>().Futz();\r\n\r\n        return 0;\r\n    }\r\n}\r\n```\r\n\r\nThe main interesting bits:\r\n* `ShadowConcreteMethodNode` that pretends that we compiled a concrete method body. This node simulates the dependencies we would have in the graph if we had compiled the concrete method body. This is done by looking at the dependencies of the canonical body and instantiating them for the concrete generic context.\r\n* Expanding canonical dependencies on instance methods back into concrete dependencies. This is necessary to be able to construct dictionaries. In the above example, we call `Gen<string>.Frob` and `Gen<Object>.Futz` but the generic dictionaries need to have stuff for `Gen<object>.Frob` and `Gen<string>.Futz` too. (We don't attempt to build generic dictionaries with holes)\r\n* `RuntimeDeterminedMethodNode` - this one lets `ShadowConcreteMethodNode` instantiate canonical dependencies into concrete dependencies.\r\n* I replaced calls to `IsSharedByGenericInstantiations` with `IsCanonicalMethod`. I blindly copied the former from NUTC, but I think it only makes sense for UTC codegen.","created_at":"2016-10-01T21:03:57Z","updated_at":"2016-10-01T21:54:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d316e0c50409e45e0aed238e4b434d80a8afb55e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corert/pulls/1969/commits","review_comments_url":"https://api.github.com/repos/dotnet/corert/pulls/1969/comments","review_comment_url":"https://api.github.com/repos/dotnet/corert/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corert/issues/1969/comments","statuses_url":"https://api.github.com/repos/dotnet/corert/statuses/5a831a89143717424be3bed864845ad96ce973fb","head":{"label":"MichalStrehovsky:dependencyMethod","ref":"dependencyMethod","sha":"5a831a89143717424be3bed864845ad96ce973fb","user":{"login":"MichalStrehovsky","id":13110571,"avatar_url":"https://avatars.githubusercontent.com/u/13110571?v=3","gravatar_id":"","url":"https://api.github.com/users/MichalStrehovsky","html_url":"https://github.com/MichalStrehovsky","followers_url":"https://api.github.com/users/MichalStrehovsky/followers","following_url":"https://api.github.com/users/MichalStrehovsky/following{/other_user}","gists_url":"https://api.github.com/users/MichalStrehovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/MichalStrehovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichalStrehovsky/subscriptions","organizations_url":"https://api.github.com/users/MichalStrehovsky/orgs","repos_url":"https://api.github.com/users/MichalStrehovsky/repos","events_url":"https://api.github.com/users/MichalStrehovsky/events{/privacy}","received_events_url":"https://api.github.com/users/MichalStrehovsky/received_events","type":"User","site_admin":false},"repo":{"id":46432791,"name":"corert","full_name":"MichalStrehovsky/corert","owner":{"login":"MichalStrehovsky","id":13110571,"avatar_url":"https://avatars.githubusercontent.com/u/13110571?v=3","gravatar_id":"","url":"https://api.github.com/users/MichalStrehovsky","html_url":"https://github.com/MichalStrehovsky","followers_url":"https://api.github.com/users/MichalStrehovsky/followers","following_url":"https://api.github.com/users/MichalStrehovsky/following{/other_user}","gists_url":"https://api.github.com/users/MichalStrehovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/MichalStrehovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichalStrehovsky/subscriptions","organizations_url":"https://api.github.com/users/MichalStrehovsky/orgs","repos_url":"https://api.github.com/users/MichalStrehovsky/repos","events_url":"https://api.github.com/users/MichalStrehovsky/events{/privacy}","received_events_url":"https://api.github.com/users/MichalStrehovsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MichalStrehovsky/corert","description":"This repo contains CoreRT, a .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying .NET Native compiler toolchain.","fork":true,"url":"https://api.github.com/repos/MichalStrehovsky/corert","forks_url":"https://api.github.com/repos/MichalStrehovsky/corert/forks","keys_url":"https://api.github.com/repos/MichalStrehovsky/corert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MichalStrehovsky/corert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MichalStrehovsky/corert/teams","hooks_url":"https://api.github.com/repos/MichalStrehovsky/corert/hooks","issue_events_url":"https://api.github.com/repos/MichalStrehovsky/corert/issues/events{/number}","events_url":"https://api.github.com/repos/MichalStrehovsky/corert/events","assignees_url":"https://api.github.com/repos/MichalStrehovsky/corert/assignees{/user}","branches_url":"https://api.github.com/repos/MichalStrehovsky/corert/branches{/branch}","tags_url":"https://api.github.com/repos/MichalStrehovsky/corert/tags","blobs_url":"https://api.github.com/repos/MichalStrehovsky/corert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MichalStrehovsky/corert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MichalStrehovsky/corert/git/refs{/sha}","trees_url":"https://api.github.com/repos/MichalStrehovsky/corert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MichalStrehovsky/corert/statuses/{sha}","languages_url":"https://api.github.com/repos/MichalStrehovsky/corert/languages","stargazers_url":"https://api.github.com/repos/MichalStrehovsky/corert/stargazers","contributors_url":"https://api.github.com/repos/MichalStrehovsky/corert/contributors","subscribers_url":"https://api.github.com/repos/MichalStrehovsky/corert/subscribers","subscription_url":"https://api.github.com/repos/MichalStrehovsky/corert/subscription","commits_url":"https://api.github.com/repos/MichalStrehovsky/corert/commits{/sha}","git_commits_url":"https://api.github.com/repos/MichalStrehovsky/corert/git/commits{/sha}","comments_url":"https://api.github.com/repos/MichalStrehovsky/corert/comments{/number}","issue_comment_url":"https://api.github.com/repos/MichalStrehovsky/corert/issues/comments{/number}","contents_url":"https://api.github.com/repos/MichalStrehovsky/corert/contents/{+path}","compare_url":"https://api.github.com/repos/MichalStrehovsky/corert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MichalStrehovsky/corert/merges","archive_url":"https://api.github.com/repos/MichalStrehovsky/corert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MichalStrehovsky/corert/downloads","issues_url":"https://api.github.com/repos/MichalStrehovsky/corert/issues{/number}","pulls_url":"https://api.github.com/repos/MichalStrehovsky/corert/pulls{/number}","milestones_url":"https://api.github.com/repos/MichalStrehovsky/corert/milestones{/number}","notifications_url":"https://api.github.com/repos/MichalStrehovsky/corert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MichalStrehovsky/corert/labels{/name}","releases_url":"https://api.github.com/repos/MichalStrehovsky/corert/releases{/id}","deployments_url":"https://api.github.com/repos/MichalStrehovsky/corert/deployments","created_at":"2015-11-18T16:45:32Z","updated_at":"2016-01-14T03:31:37Z","pushed_at":"2016-10-01T20:53:02Z","git_url":"git://github.com/MichalStrehovsky/corert.git","ssh_url":"git@github.com:MichalStrehovsky/corert.git","clone_url":"https://github.com/MichalStrehovsky/corert.git","svn_url":"https://github.com/MichalStrehovsky/corert","homepage":"http://dotnet.github.io/","size":11122,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"8ae4d04c50691ab7c99f05d9af6fc999b239e913","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":42552143,"name":"corert","full_name":"dotnet/corert","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corert","description":"This repo contains CoreRT, a .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying .NET Native compiler toolchain.","fork":false,"url":"https://api.github.com/repos/dotnet/corert","forks_url":"https://api.github.com/repos/dotnet/corert/forks","keys_url":"https://api.github.com/repos/dotnet/corert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corert/teams","hooks_url":"https://api.github.com/repos/dotnet/corert/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corert/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corert/events","assignees_url":"https://api.github.com/repos/dotnet/corert/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corert/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corert/tags","blobs_url":"https://api.github.com/repos/dotnet/corert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corert/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corert/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corert/languages","stargazers_url":"https://api.github.com/repos/dotnet/corert/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corert/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corert/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corert/subscription","commits_url":"https://api.github.com/repos/dotnet/corert/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corert/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corert/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corert/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corert/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corert/merges","archive_url":"https://api.github.com/repos/dotnet/corert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corert/downloads","issues_url":"https://api.github.com/repos/dotnet/corert/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corert/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corert/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corert/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corert/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corert/deployments","created_at":"2015-09-15T23:10:53Z","updated_at":"2016-10-01T17:12:32Z","pushed_at":"2016-10-01T21:03:58Z","git_url":"git://github.com/dotnet/corert.git","ssh_url":"git@github.com:dotnet/corert.git","clone_url":"https://github.com/dotnet/corert.git","svn_url":"https://github.com/dotnet/corert","homepage":"http://dotnet.github.io/","size":20111,"stargazers_count":413,"watchers_count":413,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":172,"forks":134,"open_issues":172,"watchers":413,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corert/pulls/1969"},"html":{"href":"https://github.com/dotnet/corert/pull/1969"},"issue":{"href":"https://api.github.com/repos/dotnet/corert/issues/1969"},"comments":{"href":"https://api.github.com/repos/dotnet/corert/issues/1969/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corert/pulls/1969/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corert/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corert/pulls/1969/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corert/statuses/5a831a89143717424be3bed864845ad96ce973fb"}}}}
{"actor":{"display_login":"MichalStrehovsky"}}