{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/20886","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/20886/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/20886/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/20886/events","html_url":"https://github.com/dotnet/coreclr/pull/20886","id":378888359,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5NDg2NTM0","number":20886,"title":"Allow jit to examine type of initonly static ref typed fields","user":{"login":"AndyAyersMS","id":10121823,"node_id":"MDQ6VXNlcjEwMTIxODIz","avatar_url":"https://avatars1.githubusercontent.com/u/10121823?v=4","gravatar_id":"","url":"https://api.github.com/users/AndyAyersMS","html_url":"https://github.com/AndyAyersMS","followers_url":"https://api.github.com/users/AndyAyersMS/followers","following_url":"https://api.github.com/users/AndyAyersMS/following{/other_user}","gists_url":"https://api.github.com/users/AndyAyersMS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndyAyersMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndyAyersMS/subscriptions","organizations_url":"https://api.github.com/users/AndyAyersMS/orgs","repos_url":"https://api.github.com/users/AndyAyersMS/repos","events_url":"https://api.github.com/users/AndyAyersMS/events{/privacy}","received_events_url":"https://api.github.com/users/AndyAyersMS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-11-08T19:45:27Z","updated_at":"2018-11-09T22:37:52Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/20886","html_url":"https://github.com/dotnet/coreclr/pull/20886","diff_url":"https://github.com/dotnet/coreclr/pull/20886.diff","patch_url":"https://github.com/dotnet/coreclr/pull/20886.patch"},"body":"The jit incorporates the value of integer and float typed initonly static\r\nfields into its codegen, if the class initializer has already run.\r\n\r\nThe jit can't incorporate the values of ref typed initonly static fields,\r\nbut the types of those values can't change, and the jit can use this knowledge\r\nto enable type based optimizations like devirtualization.\r\n\r\nIn particular for static fields initialized by complex class factory logic the\r\njit can now see the end result of that logic instead of having to try and deduce\r\nthe type of object that will initialize or did initialize the field.\r\n\r\nExamples of this factory pattern in include `EqualityComparer<T>.Default` and\r\n`Comparer<T>.Default`. The former is already optimized in some cases by via\r\nspecial-purpose modelling in the framework, jit, and runtime (see #14125) but\r\nthe latter is not. With this change calls through `Comparer<T>.Default` may now\r\nalso devirtualize (though won't yet inline as the devirtualization happens\r\nlate).\r\n\r\nAddresses #4108."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/437517068","html_url":"https://github.com/dotnet/coreclr/pull/20886#issuecomment-437517068","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/20886","id":437517068,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzUxNzA2OA==","user":{"login":"AndyAyersMS","id":10121823,"node_id":"MDQ6VXNlcjEwMTIxODIz","avatar_url":"https://avatars1.githubusercontent.com/u/10121823?v=4","gravatar_id":"","url":"https://api.github.com/users/AndyAyersMS","html_url":"https://github.com/AndyAyersMS","followers_url":"https://api.github.com/users/AndyAyersMS/followers","following_url":"https://api.github.com/users/AndyAyersMS/following{/other_user}","gists_url":"https://api.github.com/users/AndyAyersMS/gists{/gist_id}","starred_url":"https://api.github.com/users/AndyAyersMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndyAyersMS/subscriptions","organizations_url":"https://api.github.com/users/AndyAyersMS/orgs","repos_url":"https://api.github.com/users/AndyAyersMS/repos","events_url":"https://api.github.com/users/AndyAyersMS/events{/privacy}","received_events_url":"https://api.github.com/users/AndyAyersMS/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T22:37:52Z","updated_at":"2018-11-09T22:37:52Z","author_association":"MEMBER","body":"@jkotas yes I'll add the checks. Pointers welcome."}}
{"actor":{"display_login":"AndyAyersMS"}}