{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corert/pulls/comments/143904915","pull_request_review_id":68484376,"id":143904915,"diff_hunk":"@@ -304,17 +304,31 @@ private void ImportBreak()\n         private void ImportLoadVar(int index, bool argument)\n         {\n             int varBase;\n+            int varCountBase;\n             int varOffset;\n             LLVMTypeRef valueType;\n             TypeDesc type;\n \n             if (argument)\n             {\n+                varCountBase = 0;\n                 varBase = 0;\n-                // todo: this is off by one for instance methods\n+                if(!_method.Signature.IsStatic)\n+                {\n+                    varCountBase = 1;\n+                }\n+\n                 GetArgSizeAndOffsetAtIndex(index, out int argSize, out varOffset);\n-                valueType = GetLLVMTypeForTypeDesc(_method.Signature[index]);\n-                type = _method.Signature[index];\n+\n+                if (!_method.Signature.IsStatic && index == 0)\n+                {\n+                    type = _method.OwningType;","path":"src/ILCompiler.WebAssembly/src/CodeGen/ILToWebAssemblyImporter.cs","position":25,"original_position":25,"commit_id":"56fe93758547a2e3f937c443cdbcdba4524ce286","original_commit_id":"56fe93758547a2e3f937c443cdbcdba4524ce286","user":{"login":"morganbr","id":11641665,"avatar_url":"https://avatars1.githubusercontent.com/u/11641665?v=4","gravatar_id":"","url":"https://api.github.com/users/morganbr","html_url":"https://github.com/morganbr","followers_url":"https://api.github.com/users/morganbr/followers","following_url":"https://api.github.com/users/morganbr/following{/other_user}","gists_url":"https://api.github.com/users/morganbr/gists{/gist_id}","starred_url":"https://api.github.com/users/morganbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganbr/subscriptions","organizations_url":"https://api.github.com/users/morganbr/orgs","repos_url":"https://api.github.com/users/morganbr/repos","events_url":"https://api.github.com/users/morganbr/events{/privacy}","received_events_url":"https://api.github.com/users/morganbr/received_events","type":"User","site_admin":false},"body":"Good catch. Thanks!","created_at":"2017-10-11T03:30:47Z","updated_at":"2017-10-11T03:30:47Z","html_url":"https://github.com/dotnet/corert/pull/4695#discussion_r143904915","pull_request_url":"https://api.github.com/repos/dotnet/corert/pulls/4695","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corert/pulls/comments/143904915"},"html":{"href":"https://github.com/dotnet/corert/pull/4695#discussion_r143904915"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corert/pulls/4695"}},"in_reply_to_id":143385639},"pull_request":{"url":"https://api.github.com/repos/dotnet/corert/pulls/4695","id":145368647,"html_url":"https://github.com/dotnet/corert/pull/4695","diff_url":"https://github.com/dotnet/corert/pull/4695.diff","patch_url":"https://github.com/dotnet/corert/pull/4695.patch","issue_url":"https://api.github.com/repos/dotnet/corert/issues/4695","number":4695,"state":"open","locked":false,"title":"WebAssembly instance method support","user":{"login":"morganbr","id":11641665,"avatar_url":"https://avatars1.githubusercontent.com/u/11641665?v=4","gravatar_id":"","url":"https://api.github.com/users/morganbr","html_url":"https://github.com/morganbr","followers_url":"https://api.github.com/users/morganbr/followers","following_url":"https://api.github.com/users/morganbr/following{/other_user}","gists_url":"https://api.github.com/users/morganbr/gists{/gist_id}","starred_url":"https://api.github.com/users/morganbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganbr/subscriptions","organizations_url":"https://api.github.com/users/morganbr/orgs","repos_url":"https://api.github.com/users/morganbr/repos","events_url":"https://api.github.com/users/morganbr/events{/privacy}","received_events_url":"https://api.github.com/users/morganbr/received_events","type":"User","site_admin":false},"body":"Implements instance method support for WebAssembly. String.Length now works (there aren't many testable instance methods since we don't have newobj yet). By doing this, many more methods start compiling, so I had to fix bugs related to those.\r\n\r\nIncludes:\r\n* Fixing instance method 'this' parameter handling\r\n* Correcting method names to include their types since LLVM was treating all methods with the same short name as the same method\r\n* Implementing ldfld for instance fields. Fixes #4530 \r\n* Implementing leave opcode to fix bad codegen that made LLVM fail compilation\r\n* Creating trap stubs for RuntimeImport methods since we can't build the runtime yet, but ignoring them would fail compilation\r\n","created_at":"2017-10-09T03:10:57Z","updated_at":"2017-10-11T03:30:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10536c23d8d708a87cd6c0aab1bc5930bf3185f8","assignee":{"login":"morganbr","id":11641665,"avatar_url":"https://avatars1.githubusercontent.com/u/11641665?v=4","gravatar_id":"","url":"https://api.github.com/users/morganbr","html_url":"https://github.com/morganbr","followers_url":"https://api.github.com/users/morganbr/followers","following_url":"https://api.github.com/users/morganbr/following{/other_user}","gists_url":"https://api.github.com/users/morganbr/gists{/gist_id}","starred_url":"https://api.github.com/users/morganbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganbr/subscriptions","organizations_url":"https://api.github.com/users/morganbr/orgs","repos_url":"https://api.github.com/users/morganbr/repos","events_url":"https://api.github.com/users/morganbr/events{/privacy}","received_events_url":"https://api.github.com/users/morganbr/received_events","type":"User","site_admin":false},"assignees":[{"login":"morganbr","id":11641665,"avatar_url":"https://avatars1.githubusercontent.com/u/11641665?v=4","gravatar_id":"","url":"https://api.github.com/users/morganbr","html_url":"https://github.com/morganbr","followers_url":"https://api.github.com/users/morganbr/followers","following_url":"https://api.github.com/users/morganbr/following{/other_user}","gists_url":"https://api.github.com/users/morganbr/gists{/gist_id}","starred_url":"https://api.github.com/users/morganbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganbr/subscriptions","organizations_url":"https://api.github.com/users/morganbr/orgs","repos_url":"https://api.github.com/users/morganbr/repos","events_url":"https://api.github.com/users/morganbr/events{/privacy}","received_events_url":"https://api.github.com/users/morganbr/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"davidwrighton","id":10779849,"avatar_url":"https://avatars0.githubusercontent.com/u/10779849?v=4","gravatar_id":"","url":"https://api.github.com/users/davidwrighton","html_url":"https://github.com/davidwrighton","followers_url":"https://api.github.com/users/davidwrighton/followers","following_url":"https://api.github.com/users/davidwrighton/following{/other_user}","gists_url":"https://api.github.com/users/davidwrighton/gists{/gist_id}","starred_url":"https://api.github.com/users/davidwrighton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidwrighton/subscriptions","organizations_url":"https://api.github.com/users/davidwrighton/orgs","repos_url":"https://api.github.com/users/davidwrighton/repos","events_url":"https://api.github.com/users/davidwrighton/events{/privacy}","received_events_url":"https://api.github.com/users/davidwrighton/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/corert/pulls/4695/commits","review_comments_url":"https://api.github.com/repos/dotnet/corert/pulls/4695/comments","review_comment_url":"https://api.github.com/repos/dotnet/corert/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corert/issues/4695/comments","statuses_url":"https://api.github.com/repos/dotnet/corert/statuses/56fe93758547a2e3f937c443cdbcdba4524ce286","head":{"label":"morganbr:InstanceMethods","ref":"InstanceMethods","sha":"56fe93758547a2e3f937c443cdbcdba4524ce286","user":{"login":"morganbr","id":11641665,"avatar_url":"https://avatars1.githubusercontent.com/u/11641665?v=4","gravatar_id":"","url":"https://api.github.com/users/morganbr","html_url":"https://github.com/morganbr","followers_url":"https://api.github.com/users/morganbr/followers","following_url":"https://api.github.com/users/morganbr/following{/other_user}","gists_url":"https://api.github.com/users/morganbr/gists{/gist_id}","starred_url":"https://api.github.com/users/morganbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganbr/subscriptions","organizations_url":"https://api.github.com/users/morganbr/orgs","repos_url":"https://api.github.com/users/morganbr/repos","events_url":"https://api.github.com/users/morganbr/events{/privacy}","received_events_url":"https://api.github.com/users/morganbr/received_events","type":"User","site_admin":false},"repo":{"id":46458494,"name":"corert","full_name":"morganbr/corert","owner":{"login":"morganbr","id":11641665,"avatar_url":"https://avatars1.githubusercontent.com/u/11641665?v=4","gravatar_id":"","url":"https://api.github.com/users/morganbr","html_url":"https://github.com/morganbr","followers_url":"https://api.github.com/users/morganbr/followers","following_url":"https://api.github.com/users/morganbr/following{/other_user}","gists_url":"https://api.github.com/users/morganbr/gists{/gist_id}","starred_url":"https://api.github.com/users/morganbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganbr/subscriptions","organizations_url":"https://api.github.com/users/morganbr/orgs","repos_url":"https://api.github.com/users/morganbr/repos","events_url":"https://api.github.com/users/morganbr/events{/privacy}","received_events_url":"https://api.github.com/users/morganbr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/morganbr/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/morganbr/corert","forks_url":"https://api.github.com/repos/morganbr/corert/forks","keys_url":"https://api.github.com/repos/morganbr/corert/keys{/key_id}","collaborators_url":"https://api.github.com/repos/morganbr/corert/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/morganbr/corert/teams","hooks_url":"https://api.github.com/repos/morganbr/corert/hooks","issue_events_url":"https://api.github.com/repos/morganbr/corert/issues/events{/number}","events_url":"https://api.github.com/repos/morganbr/corert/events","assignees_url":"https://api.github.com/repos/morganbr/corert/assignees{/user}","branches_url":"https://api.github.com/repos/morganbr/corert/branches{/branch}","tags_url":"https://api.github.com/repos/morganbr/corert/tags","blobs_url":"https://api.github.com/repos/morganbr/corert/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/morganbr/corert/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/morganbr/corert/git/refs{/sha}","trees_url":"https://api.github.com/repos/morganbr/corert/git/trees{/sha}","statuses_url":"https://api.github.com/repos/morganbr/corert/statuses/{sha}","languages_url":"https://api.github.com/repos/morganbr/corert/languages","stargazers_url":"https://api.github.com/repos/morganbr/corert/stargazers","contributors_url":"https://api.github.com/repos/morganbr/corert/contributors","subscribers_url":"https://api.github.com/repos/morganbr/corert/subscribers","subscription_url":"https://api.github.com/repos/morganbr/corert/subscription","commits_url":"https://api.github.com/repos/morganbr/corert/commits{/sha}","git_commits_url":"https://api.github.com/repos/morganbr/corert/git/commits{/sha}","comments_url":"https://api.github.com/repos/morganbr/corert/comments{/number}","issue_comment_url":"https://api.github.com/repos/morganbr/corert/issues/comments{/number}","contents_url":"https://api.github.com/repos/morganbr/corert/contents/{+path}","compare_url":"https://api.github.com/repos/morganbr/corert/compare/{base}...{head}","merges_url":"https://api.github.com/repos/morganbr/corert/merges","archive_url":"https://api.github.com/repos/morganbr/corert/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/morganbr/corert/downloads","issues_url":"https://api.github.com/repos/morganbr/corert/issues{/number}","pulls_url":"https://api.github.com/repos/morganbr/corert/pulls{/number}","milestones_url":"https://api.github.com/repos/morganbr/corert/milestones{/number}","notifications_url":"https://api.github.com/repos/morganbr/corert/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/morganbr/corert/labels{/name}","releases_url":"https://api.github.com/repos/morganbr/corert/releases{/id}","deployments_url":"https://api.github.com/repos/morganbr/corert/deployments","created_at":"2015-11-19T01:14:53Z","updated_at":"2017-01-10T03:26:37Z","pushed_at":"2017-10-10T03:28:20Z","git_url":"git://github.com/morganbr/corert.git","ssh_url":"git@github.com:morganbr/corert.git","clone_url":"https://github.com/morganbr/corert.git","svn_url":"https://github.com/morganbr/corert","homepage":"http://dotnet.github.io/","size":21597,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"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":"08bb1cfa2db8006b9c48f790c1e54b08292fb772","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","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://avatars0.githubusercontent.com/u/9141961?v=4","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":"2017-10-10T00:27:12Z","pushed_at":"2017-10-11T01:29:36Z","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://dot.net","size":21516,"stargazers_count":738,"watchers_count":738,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":248,"mirror_url":null,"open_issues_count":253,"forks":248,"open_issues":253,"watchers":738,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corert/pulls/4695"},"html":{"href":"https://github.com/dotnet/corert/pull/4695"},"issue":{"href":"https://api.github.com/repos/dotnet/corert/issues/4695"},"comments":{"href":"https://api.github.com/repos/dotnet/corert/issues/4695/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corert/pulls/4695/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corert/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corert/pulls/4695/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corert/statuses/56fe93758547a2e3f937c443cdbcdba4524ce286"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"morganbr"}}