{"action":"created","comment":{"url":"https://api.github.com/repos/eclipse/openj9/pulls/comments/211658559","pull_request_review_id":148127166,"id":211658559,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTY1ODU1OQ==","diff_hunk":"@@ -78,6 +78,48 @@ jitGetInterfaceITableIndexFromCP(J9VMThread *currentThread, J9ConstantPool *cons\n \treturn interfaceClass;\n }\n \n+/* Only returns non-null if the method is not to be dispatched by itable, i.e.\n+ * if it is:\n+ * - private, using direct dispatch;\n+ * - a final method of Object, using direct dispatch; or\n+ * - a non-final method of Object, using virtual dispatch.\n+ */\n+J9Method*\n+jitGetImproperInterfaceMethodFromCP(J9VMThread *currentThread, J9ConstantPool *constantPool, UDATA cpIndex)\n+{\n+\tJ9RAMInterfaceMethodRef *ramMethodRef = (J9RAMInterfaceMethodRef*)constantPool + cpIndex;\n+\t/* interfaceClass is used to indicate 'resolved'. Make sure to read it first */\n+\tJ9Class* volatile interfaceClass = (J9Class*)ramMethodRef->interfaceClass;\n+\tVM_AtomicSupport::readBarrier();\n+\tUDATA volatile methodIndexAndArgCount = ramMethodRef->methodIndexAndArgCount;\n+\tJ9Method *improperMethod = NULL;\n+\t/* If the ref is resolved, do not call the resolve helper, as it will currently fail if the interface class is not initialized */\n+\tif (NULL == interfaceClass) {\n+\t\tJ9RAMInterfaceMethodRef localEntry;\n+\t\tif (NULL == currentThread->javaVM->internalVMFunctions->resolveInterfaceMethodRefInto(currentThread, constantPool, cpIndex, J9_RESOLVE_FLAG_JIT_COMPILE_TIME, &localEntry)) {\n+\t\t\tgoto done;\n+\t\t}\n+\t\tinterfaceClass = (J9Class*)localEntry.interfaceClass;\n+\t\tmethodIndexAndArgCount = localEntry.methodIndexAndArgCount;\n+\t}\n+\tif (J9_ARE_ANY_BITS_SET(methodIndexAndArgCount, J9_ITABLE_INDEX_TAG_BITS)) {\n+\t\tUDATA methodIndex = (methodIndexAndArgCount & ~J9_ITABLE_INDEX_TAG_BITS) >> 8;\n+\t\tJ9Class *jlObject = J9VMJAVALANGOBJECT_OR_NULL(currentThread->javaVM);\n+\t\tif (J9_ARE_NO_BITS_SET(methodIndexAndArgCount, J9_ITABLE_INDEX_METHOD_INDEX)) {\n+\t\t\t/* Object method in the vTable */\n+\t\t\timproperMethod = *(J9Method**)((UDATA)jlObject + methodIndex);\n+\t\t} else if (J9_ARE_ANY_BITS_SET(methodIndexAndArgCount, J9_ITABLE_INDEX_OBJECT)) {\n+\t\t\t/* Object method not in the vTable */\n+\t\t\timproperMethod = jlObject->ramMethods + methodIndex;\n+\t\t} else {\n+\t\t\t/* Private interface method */\n+\t\t\timproperMethod = interfaceClass->ramMethods + methodIndex;\n+\t\t}\n+\t}\n+done:\n+\treturn improperMethod;","path":"runtime/jit_vm/cthelpers.cpp","position":52,"original_position":52,"commit_id":"5df7ea7b8c869dc9d575a37b2bf086a829a7fd7b","original_commit_id":"5df7ea7b8c869dc9d575a37b2bf086a829a7fd7b","user":{"login":"DanHeidinga","id":8503711,"node_id":"MDQ6VXNlcjg1MDM3MTE=","avatar_url":"https://avatars2.githubusercontent.com/u/8503711?v=4","gravatar_id":"","url":"https://api.github.com/users/DanHeidinga","html_url":"https://github.com/DanHeidinga","followers_url":"https://api.github.com/users/DanHeidinga/followers","following_url":"https://api.github.com/users/DanHeidinga/following{/other_user}","gists_url":"https://api.github.com/users/DanHeidinga/gists{/gist_id}","starred_url":"https://api.github.com/users/DanHeidinga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanHeidinga/subscriptions","organizations_url":"https://api.github.com/users/DanHeidinga/orgs","repos_url":"https://api.github.com/users/DanHeidinga/repos","events_url":"https://api.github.com/users/DanHeidinga/events{/privacy}","received_events_url":"https://api.github.com/users/DanHeidinga/received_events","type":"User","site_admin":false},"body":"Can you also update the comments to include this info in the code?  It'll save someone a lot of digging and frustration in the future if we can record this now while it's fresh.","created_at":"2018-08-21T15:48:09Z","updated_at":"2018-08-21T15:48:09Z","html_url":"https://github.com/eclipse/openj9/pull/2648#discussion_r211658559","pull_request_url":"https://api.github.com/repos/eclipse/openj9/pulls/2648","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/comments/211658559"},"html":{"href":"https://github.com/eclipse/openj9/pull/2648#discussion_r211658559"},"pull_request":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/2648"}},"in_reply_to_id":211633080},"pull_request":{"url":"https://api.github.com/repos/eclipse/openj9/pulls/2648","id":209235267,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MjM1MjY3","html_url":"https://github.com/eclipse/openj9/pull/2648","diff_url":"https://github.com/eclipse/openj9/pull/2648.diff","patch_url":"https://github.com/eclipse/openj9/pull/2648.patch","issue_url":"https://api.github.com/repos/eclipse/openj9/issues/2648","number":2648,"state":"open","locked":false,"title":"JIT: Handle resolved special case invokeinterface","user":{"login":"jdmpapin","id":22403820,"node_id":"MDQ6VXNlcjIyNDAzODIw","avatar_url":"https://avatars3.githubusercontent.com/u/22403820?v=4","gravatar_id":"","url":"https://api.github.com/users/jdmpapin","html_url":"https://github.com/jdmpapin","followers_url":"https://api.github.com/users/jdmpapin/followers","following_url":"https://api.github.com/users/jdmpapin/following{/other_user}","gists_url":"https://api.github.com/users/jdmpapin/gists{/gist_id}","starred_url":"https://api.github.com/users/jdmpapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdmpapin/subscriptions","organizations_url":"https://api.github.com/users/jdmpapin/orgs","repos_url":"https://api.github.com/users/jdmpapin/repos","events_url":"https://api.github.com/users/jdmpapin/events{/privacy}","received_events_url":"https://api.github.com/users/jdmpapin/received_events","type":"User","site_admin":false},"body":"This commit adds jitGetImproperInterfaceMethodFromCP() so that the\r\ncompiler can query an InterfaceMethod constant pool entry to determine\r\nwhether it has been resolved to a method that does not use the usual\r\ninterface dispatch, i.e. to a private method or a method of Object. The\r\nexisting queries continue to respond in these cases as though the\r\nconstant pool entry is unresolved, so that these possibilities are only\r\nexposed to callers prepared to deal with them.\r\n\r\nWhen generating intermediate language for an invokeinterface bytecode\r\ninstruction, the compiler checks for these cases and generates a call\r\nusing the appropriate kind of dispatch. When not using interface\r\ndispatch, it generates an explicit type check ahead of the call.\r\n\r\nWhen the inliner encounters an invokeinterface bytecode instruction, it\r\nchecks for these cases in order to correctly determine which call\r\ntarget(s) to consider.\r\n\r\nSpecial case invokeinterface is not yet handled in cases where the\r\nconstant pool entry is unresolved at compile time. Nor is it handled in\r\nAOT compilations, where for the time being these calls will be treated\r\nas though their constant pool entries are unresolved.","created_at":"2018-08-17T19:18:03Z","updated_at":"2018-08-21T15:48:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0914444d43f09fa36b7ff1f47f80b4005eec1544","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":697962585,"node_id":"MDU6TGFiZWw2OTc5NjI1ODU=","url":"https://api.github.com/repos/eclipse/openj9/labels/comp:jit","name":"comp:jit","color":"1d76db","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/eclipse/openj9/pulls/2648/commits","review_comments_url":"https://api.github.com/repos/eclipse/openj9/pulls/2648/comments","review_comment_url":"https://api.github.com/repos/eclipse/openj9/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eclipse/openj9/issues/2648/comments","statuses_url":"https://api.github.com/repos/eclipse/openj9/statuses/5df7ea7b8c869dc9d575a37b2bf086a829a7fd7b","head":{"label":"jdmpapin:nest-priv-resolved-invokeinterface","ref":"nest-priv-resolved-invokeinterface","sha":"5df7ea7b8c869dc9d575a37b2bf086a829a7fd7b","user":{"login":"jdmpapin","id":22403820,"node_id":"MDQ6VXNlcjIyNDAzODIw","avatar_url":"https://avatars3.githubusercontent.com/u/22403820?v=4","gravatar_id":"","url":"https://api.github.com/users/jdmpapin","html_url":"https://github.com/jdmpapin","followers_url":"https://api.github.com/users/jdmpapin/followers","following_url":"https://api.github.com/users/jdmpapin/following{/other_user}","gists_url":"https://api.github.com/users/jdmpapin/gists{/gist_id}","starred_url":"https://api.github.com/users/jdmpapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdmpapin/subscriptions","organizations_url":"https://api.github.com/users/jdmpapin/orgs","repos_url":"https://api.github.com/users/jdmpapin/repos","events_url":"https://api.github.com/users/jdmpapin/events{/privacy}","received_events_url":"https://api.github.com/users/jdmpapin/received_events","type":"User","site_admin":false},"repo":{"id":104359190,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQzNTkxOTA=","name":"openj9","full_name":"jdmpapin/openj9","owner":{"login":"jdmpapin","id":22403820,"node_id":"MDQ6VXNlcjIyNDAzODIw","avatar_url":"https://avatars3.githubusercontent.com/u/22403820?v=4","gravatar_id":"","url":"https://api.github.com/users/jdmpapin","html_url":"https://github.com/jdmpapin","followers_url":"https://api.github.com/users/jdmpapin/followers","following_url":"https://api.github.com/users/jdmpapin/following{/other_user}","gists_url":"https://api.github.com/users/jdmpapin/gists{/gist_id}","starred_url":"https://api.github.com/users/jdmpapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdmpapin/subscriptions","organizations_url":"https://api.github.com/users/jdmpapin/orgs","repos_url":"https://api.github.com/users/jdmpapin/repos","events_url":"https://api.github.com/users/jdmpapin/events{/privacy}","received_events_url":"https://api.github.com/users/jdmpapin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdmpapin/openj9","description":"Eclipse OpenJ9","fork":true,"url":"https://api.github.com/repos/jdmpapin/openj9","forks_url":"https://api.github.com/repos/jdmpapin/openj9/forks","keys_url":"https://api.github.com/repos/jdmpapin/openj9/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdmpapin/openj9/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdmpapin/openj9/teams","hooks_url":"https://api.github.com/repos/jdmpapin/openj9/hooks","issue_events_url":"https://api.github.com/repos/jdmpapin/openj9/issues/events{/number}","events_url":"https://api.github.com/repos/jdmpapin/openj9/events","assignees_url":"https://api.github.com/repos/jdmpapin/openj9/assignees{/user}","branches_url":"https://api.github.com/repos/jdmpapin/openj9/branches{/branch}","tags_url":"https://api.github.com/repos/jdmpapin/openj9/tags","blobs_url":"https://api.github.com/repos/jdmpapin/openj9/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdmpapin/openj9/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdmpapin/openj9/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdmpapin/openj9/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdmpapin/openj9/statuses/{sha}","languages_url":"https://api.github.com/repos/jdmpapin/openj9/languages","stargazers_url":"https://api.github.com/repos/jdmpapin/openj9/stargazers","contributors_url":"https://api.github.com/repos/jdmpapin/openj9/contributors","subscribers_url":"https://api.github.com/repos/jdmpapin/openj9/subscribers","subscription_url":"https://api.github.com/repos/jdmpapin/openj9/subscription","commits_url":"https://api.github.com/repos/jdmpapin/openj9/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdmpapin/openj9/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdmpapin/openj9/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdmpapin/openj9/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdmpapin/openj9/contents/{+path}","compare_url":"https://api.github.com/repos/jdmpapin/openj9/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdmpapin/openj9/merges","archive_url":"https://api.github.com/repos/jdmpapin/openj9/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdmpapin/openj9/downloads","issues_url":"https://api.github.com/repos/jdmpapin/openj9/issues{/number}","pulls_url":"https://api.github.com/repos/jdmpapin/openj9/pulls{/number}","milestones_url":"https://api.github.com/repos/jdmpapin/openj9/milestones{/number}","notifications_url":"https://api.github.com/repos/jdmpapin/openj9/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdmpapin/openj9/labels{/name}","releases_url":"https://api.github.com/repos/jdmpapin/openj9/releases{/id}","deployments_url":"https://api.github.com/repos/jdmpapin/openj9/deployments","created_at":"2017-09-21T14:32:53Z","updated_at":"2018-08-17T17:03:42Z","pushed_at":"2018-08-20T21:25:00Z","git_url":"git://github.com/jdmpapin/openj9.git","ssh_url":"git@github.com:jdmpapin/openj9.git","clone_url":"https://github.com/jdmpapin/openj9.git","svn_url":"https://github.com/jdmpapin/openj9","homepage":"","size":33240,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eclipse:master","ref":"master","sha":"8c71b82b8e281886f0bd9b440573753c024b1b19","user":{"login":"eclipse","id":56974,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2OTc0","avatar_url":"https://avatars1.githubusercontent.com/u/56974?v=4","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"repo":{"id":101408117,"node_id":"MDEwOlJlcG9zaXRvcnkxMDE0MDgxMTc=","name":"openj9","full_name":"eclipse/openj9","owner":{"login":"eclipse","id":56974,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2OTc0","avatar_url":"https://avatars1.githubusercontent.com/u/56974?v=4","gravatar_id":"","url":"https://api.github.com/users/eclipse","html_url":"https://github.com/eclipse","followers_url":"https://api.github.com/users/eclipse/followers","following_url":"https://api.github.com/users/eclipse/following{/other_user}","gists_url":"https://api.github.com/users/eclipse/gists{/gist_id}","starred_url":"https://api.github.com/users/eclipse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eclipse/subscriptions","organizations_url":"https://api.github.com/users/eclipse/orgs","repos_url":"https://api.github.com/users/eclipse/repos","events_url":"https://api.github.com/users/eclipse/events{/privacy}","received_events_url":"https://api.github.com/users/eclipse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eclipse/openj9","description":"Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput.   Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.","fork":false,"url":"https://api.github.com/repos/eclipse/openj9","forks_url":"https://api.github.com/repos/eclipse/openj9/forks","keys_url":"https://api.github.com/repos/eclipse/openj9/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eclipse/openj9/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eclipse/openj9/teams","hooks_url":"https://api.github.com/repos/eclipse/openj9/hooks","issue_events_url":"https://api.github.com/repos/eclipse/openj9/issues/events{/number}","events_url":"https://api.github.com/repos/eclipse/openj9/events","assignees_url":"https://api.github.com/repos/eclipse/openj9/assignees{/user}","branches_url":"https://api.github.com/repos/eclipse/openj9/branches{/branch}","tags_url":"https://api.github.com/repos/eclipse/openj9/tags","blobs_url":"https://api.github.com/repos/eclipse/openj9/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eclipse/openj9/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eclipse/openj9/git/refs{/sha}","trees_url":"https://api.github.com/repos/eclipse/openj9/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eclipse/openj9/statuses/{sha}","languages_url":"https://api.github.com/repos/eclipse/openj9/languages","stargazers_url":"https://api.github.com/repos/eclipse/openj9/stargazers","contributors_url":"https://api.github.com/repos/eclipse/openj9/contributors","subscribers_url":"https://api.github.com/repos/eclipse/openj9/subscribers","subscription_url":"https://api.github.com/repos/eclipse/openj9/subscription","commits_url":"https://api.github.com/repos/eclipse/openj9/commits{/sha}","git_commits_url":"https://api.github.com/repos/eclipse/openj9/git/commits{/sha}","comments_url":"https://api.github.com/repos/eclipse/openj9/comments{/number}","issue_comment_url":"https://api.github.com/repos/eclipse/openj9/issues/comments{/number}","contents_url":"https://api.github.com/repos/eclipse/openj9/contents/{+path}","compare_url":"https://api.github.com/repos/eclipse/openj9/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eclipse/openj9/merges","archive_url":"https://api.github.com/repos/eclipse/openj9/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eclipse/openj9/downloads","issues_url":"https://api.github.com/repos/eclipse/openj9/issues{/number}","pulls_url":"https://api.github.com/repos/eclipse/openj9/pulls{/number}","milestones_url":"https://api.github.com/repos/eclipse/openj9/milestones{/number}","notifications_url":"https://api.github.com/repos/eclipse/openj9/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eclipse/openj9/labels{/name}","releases_url":"https://api.github.com/repos/eclipse/openj9/releases{/id}","deployments_url":"https://api.github.com/repos/eclipse/openj9/deployments","created_at":"2017-08-25T13:46:07Z","updated_at":"2018-08-21T15:46:31Z","pushed_at":"2018-08-21T15:46:15Z","git_url":"git://github.com/eclipse/openj9.git","ssh_url":"git@github.com:eclipse/openj9.git","clone_url":"https://github.com/eclipse/openj9.git","svn_url":"https://github.com/eclipse/openj9","homepage":"","size":33258,"stargazers_count":1385,"watchers_count":1385,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":270,"mirror_url":null,"archived":false,"open_issues_count":441,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":270,"open_issues":441,"watchers":1385,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/2648"},"html":{"href":"https://github.com/eclipse/openj9/pull/2648"},"issue":{"href":"https://api.github.com/repos/eclipse/openj9/issues/2648"},"comments":{"href":"https://api.github.com/repos/eclipse/openj9/issues/2648/comments"},"review_comments":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/2648/comments"},"review_comment":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eclipse/openj9/pulls/2648/commits"},"statuses":{"href":"https://api.github.com/repos/eclipse/openj9/statuses/5df7ea7b8c869dc9d575a37b2bf086a829a7fd7b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"DanHeidinga"}}