{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corert/pulls/comments/63805211","id":63805211,"diff_hunk":"@@ -37,7 +37,7 @@ private static Lock GetLock(Object obj)\n                 throw new ArgumentNullException(\"obj\");\n \n             if (Lock.IsLock(obj))\n-                return (Lock)obj;\n+                return RuntimeHelpers.UncheckedCast<Lock>(obj);","path":"src/System.Private.CoreLib/src/System/Threading/Monitor.cs","position":5,"original_position":5,"commit_id":"1495d032a0bef5f56f03a87fd2ecbba1c8a44dad","original_commit_id":"1495d032a0bef5f56f03a87fd2ecbba1c8a44dad","user":{"login":"manu-silicon","id":13194660,"avatar_url":"https://avatars.githubusercontent.com/u/13194660?v=3","gravatar_id":"","url":"https://api.github.com/users/manu-silicon","html_url":"https://github.com/manu-silicon","followers_url":"https://api.github.com/users/manu-silicon/followers","following_url":"https://api.github.com/users/manu-silicon/following{/other_user}","gists_url":"https://api.github.com/users/manu-silicon/gists{/gist_id}","starred_url":"https://api.github.com/users/manu-silicon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manu-silicon/subscriptions","organizations_url":"https://api.github.com/users/manu-silicon/orgs","repos_url":"https://api.github.com/users/manu-silicon/repos","events_url":"https://api.github.com/users/manu-silicon/events{/privacy}","received_events_url":"https://api.github.com/users/manu-silicon/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2016-05-19T00:16:28Z","updated_at":"2016-05-19T00:16:28Z","html_url":"https://github.com/dotnet/corert/pull/1288#discussion_r63805211","pull_request_url":"https://api.github.com/repos/dotnet/corert/pulls/1288","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corert/pulls/comments/63805211"},"html":{"href":"https://github.com/dotnet/corert/pull/1288#discussion_r63805211"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corert/pulls/1288"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corert/pulls/1288","id":70301433,"html_url":"https://github.com/dotnet/corert/pull/1288","diff_url":"https://github.com/dotnet/corert/pull/1288.diff","patch_url":"https://github.com/dotnet/corert/pull/1288.patch","issue_url":"https://api.github.com/repos/dotnet/corert/issues/1288","number":1288,"state":"closed","locked":false,"title":"Monitor.GetLock: No dynamic type checks if IsLock == true","user":{"login":"jamesqo","id":9159214,"avatar_url":"https://avatars.githubusercontent.com/u/9159214?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesqo","html_url":"https://github.com/jamesqo","followers_url":"https://api.github.com/users/jamesqo/followers","following_url":"https://api.github.com/users/jamesqo/following{/other_user}","gists_url":"https://api.github.com/users/jamesqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesqo/subscriptions","organizations_url":"https://api.github.com/users/jamesqo/orgs","repos_url":"https://api.github.com/users/jamesqo/repos","events_url":"https://api.github.com/users/jamesqo/events{/privacy}","received_events_url":"https://api.github.com/users/jamesqo/received_events","type":"User","site_admin":false},"body":"`Monitor.GetLock` uses `Lock.IsLock` to determine whether a given object is a `Lock`. The `Lock.IsLock` function is [optimized](https://github.com/dotnet/corert/blob/4376c55dd018d8b7b9fed82449728711231ba266/src/System.Private.CoreLib/src/System/Threading/Lock.cs#L25-L26) to avoid \"the overhead of the full casting logic in the runtime,\" yet we still perform a typecheck when we cast to `Lock` since the compiler doesn't know that `obj` must be an instance of `Lock` at that point.\r\n\r\nThis change changes it to use `RuntimeHelpers.UncheckedCast` instead of a regular cast to avoid the overhead of dynamic typechecking.\r\n\r\nPublic methods this affects (if `obj` is a `Lock`):\r\n\r\n- `Enter`\r\n- `TryEnter`\r\n- `Exit`\r\n- `IsEntered`\r\n\r\ncc @jkotas ","created_at":"2016-05-17T05:24:36Z","updated_at":"2016-05-19T00:16:28Z","closed_at":"2016-05-17T06:18:07Z","merged_at":"2016-05-17T06:18:07Z","merge_commit_sha":"07a040062c28f415a40efab7d924d143922e8a1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corert/pulls/1288/commits","review_comments_url":"https://api.github.com/repos/dotnet/corert/pulls/1288/comments","review_comment_url":"https://api.github.com/repos/dotnet/corert/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corert/issues/1288/comments","statuses_url":"https://api.github.com/repos/dotnet/corert/statuses/1495d032a0bef5f56f03a87fd2ecbba1c8a44dad","head":{"label":"jamesqo:patch-2","ref":"patch-2","sha":"1495d032a0bef5f56f03a87fd2ecbba1c8a44dad","user":{"login":"jamesqo","id":9159214,"avatar_url":"https://avatars.githubusercontent.com/u/9159214?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesqo","html_url":"https://github.com/jamesqo","followers_url":"https://api.github.com/users/jamesqo/followers","following_url":"https://api.github.com/users/jamesqo/following{/other_user}","gists_url":"https://api.github.com/users/jamesqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesqo/subscriptions","organizations_url":"https://api.github.com/users/jamesqo/orgs","repos_url":"https://api.github.com/users/jamesqo/repos","events_url":"https://api.github.com/users/jamesqo/events{/privacy}","received_events_url":"https://api.github.com/users/jamesqo/received_events","type":"User","site_admin":false},"repo":{"id":52163883,"name":"corert","full_name":"jamesqo/corert","owner":{"login":"jamesqo","id":9159214,"avatar_url":"https://avatars.githubusercontent.com/u/9159214?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesqo","html_url":"https://github.com/jamesqo","followers_url":"https://api.github.com/users/jamesqo/followers","following_url":"https://api.github.com/users/jamesqo/following{/other_user}","gists_url":"https://api.github.com/users/jamesqo/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesqo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesqo/subscriptions","organizations_url":"https://api.github.com/users/jamesqo/orgs","repos_url":"https://api.github.com/users/jamesqo/repos","events_url":"https://api.github.com/users/jamesqo/events{/privacy}","received_events_url":"https://api.github.com/users/jamesqo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jamesqo/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/jamesqo/corert","forks_url":"https://api.github.com/repos/jamesqo/corert/forks","keys_url":"https://api.github.com/repos/jamesqo/corert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jamesqo/corert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jamesqo/corert/teams","hooks_url":"https://api.github.com/repos/jamesqo/corert/hooks","issue_events_url":"https://api.github.com/repos/jamesqo/corert/issues/events{/number}","events_url":"https://api.github.com/repos/jamesqo/corert/events","assignees_url":"https://api.github.com/repos/jamesqo/corert/assignees{/user}","branches_url":"https://api.github.com/repos/jamesqo/corert/branches{/branch}","tags_url":"https://api.github.com/repos/jamesqo/corert/tags","blobs_url":"https://api.github.com/repos/jamesqo/corert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jamesqo/corert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jamesqo/corert/git/refs{/sha}","trees_url":"https://api.github.com/repos/jamesqo/corert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jamesqo/corert/statuses/{sha}","languages_url":"https://api.github.com/repos/jamesqo/corert/languages","stargazers_url":"https://api.github.com/repos/jamesqo/corert/stargazers","contributors_url":"https://api.github.com/repos/jamesqo/corert/contributors","subscribers_url":"https://api.github.com/repos/jamesqo/corert/subscribers","subscription_url":"https://api.github.com/repos/jamesqo/corert/subscription","commits_url":"https://api.github.com/repos/jamesqo/corert/commits{/sha}","git_commits_url":"https://api.github.com/repos/jamesqo/corert/git/commits{/sha}","comments_url":"https://api.github.com/repos/jamesqo/corert/comments{/number}","issue_comment_url":"https://api.github.com/repos/jamesqo/corert/issues/comments{/number}","contents_url":"https://api.github.com/repos/jamesqo/corert/contents/{+path}","compare_url":"https://api.github.com/repos/jamesqo/corert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jamesqo/corert/merges","archive_url":"https://api.github.com/repos/jamesqo/corert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jamesqo/corert/downloads","issues_url":"https://api.github.com/repos/jamesqo/corert/issues{/number}","pulls_url":"https://api.github.com/repos/jamesqo/corert/pulls{/number}","milestones_url":"https://api.github.com/repos/jamesqo/corert/milestones{/number}","notifications_url":"https://api.github.com/repos/jamesqo/corert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jamesqo/corert/labels{/name}","releases_url":"https://api.github.com/repos/jamesqo/corert/releases{/id}","deployments_url":"https://api.github.com/repos/jamesqo/corert/deployments","created_at":"2016-02-20T16:48:10Z","updated_at":"2016-02-20T19:11:55Z","pushed_at":"2016-05-18T17:41:02Z","git_url":"git://github.com/jamesqo/corert.git","ssh_url":"git@github.com:jamesqo/corert.git","clone_url":"https://github.com/jamesqo/corert.git","svn_url":"https://github.com/jamesqo/corert","homepage":"http://dotnet.github.io/","size":9677,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"9e2f89a0f23530b1cdc3d4d38b56d3acf4d5b281","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-05-18T10:31:03Z","pushed_at":"2016-05-18T22:21:55Z","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":17938,"stargazers_count":343,"watchers_count":343,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":142,"forks":97,"open_issues":142,"watchers":343,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corert/pulls/1288"},"html":{"href":"https://github.com/dotnet/corert/pull/1288"},"issue":{"href":"https://api.github.com/repos/dotnet/corert/issues/1288"},"comments":{"href":"https://api.github.com/repos/dotnet/corert/issues/1288/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corert/pulls/1288/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corert/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corert/pulls/1288/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corert/statuses/1495d032a0bef5f56f03a87fd2ecbba1c8a44dad"}}}}