{"action":"created","comment":{"url":"https://api.github.com/repos/privat/nit/pulls/comments/31062816","id":31062816,"diff_hunk":"@@ -376,18 +405,33 @@ redef class MClass\n \t# True when the class is effectively loaded by the vm, false otherwise\n \tvar loaded: Bool = false\n \n+\t# Indicate this class was partially loaded (it only has its identifier allocated)\n+\tvar abstract_loaded: Bool = false\n+\n \t# Color for Cohen subtyping test : the absolute position of the id\n \t# of this class in virtual tables\n \tvar color: Int\n \n-\t# For each loaded subclass, keep the position of the group of attributes\n-\t# introduced by self class in the object\n+\t# For superclasses which have a non-invariant position, keep their position in attribute table\n \tvar positions_attributes: HashMap[MClass, Int] = new HashMap[MClass, Int]\n \n-\t# For each loaded subclass, keep the position of the group of methods\n-\t# introduced by self class in the vtable\n+\t# For superclasses which have a non-invariant position, keep their position in virtual table\n \tvar positions_methods: HashMap[MClass, Int] = new HashMap[MClass, Int]\n \n+\t# The position of the class' block in virtual table,\n+\t# the position is set to -1 when the invariant position is no longer satisfied\n+\tvar position_attributes: Int\n+\n+\t# The position of the class' block in attribute table\n+\t# the position is set to -1 when the invariant position is no longer satisfied\n+\tvar position_methods: Int\n+\n+\t# The chosen prefix for this class\n+\tvar prefix: nullable MClass","path":"src/vm/virtual_machine.nit","position":138,"original_position":138,"commit_id":"2ac2b09e11f7eccc58db6e1ea401df8e77215048","original_commit_id":"2ac2b09e11f7eccc58db6e1ea401df8e77215048","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"body":"wat?","created_at":"2015-05-26T18:16:01Z","updated_at":"2015-05-26T18:16:01Z","html_url":"https://github.com/privat/nit/pull/1398#discussion_r31062816","pull_request_url":"https://api.github.com/repos/privat/nit/pulls/1398","_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/comments/31062816"},"html":{"href":"https://github.com/privat/nit/pull/1398#discussion_r31062816"},"pull_request":{"href":"https://api.github.com/repos/privat/nit/pulls/1398"}}},"pull_request":{"url":"https://api.github.com/repos/privat/nit/pulls/1398","id":36204196,"html_url":"https://github.com/privat/nit/pull/1398","diff_url":"https://github.com/privat/nit/pull/1398.diff","patch_url":"https://github.com/privat/nit/pull/1398.patch","issue_url":"https://api.github.com/repos/privat/nit/issues/1398","number":1398,"state":"open","locked":false,"title":"Improve internal mechanisms of the nitvm","user":{"login":"jpages","id":2535352,"avatar_url":"https://avatars.githubusercontent.com/u/2535352?v=3","gravatar_id":"","url":"https://api.github.com/users/jpages","html_url":"https://github.com/jpages","followers_url":"https://api.github.com/users/jpages/followers","following_url":"https://api.github.com/users/jpages/following{/other_user}","gists_url":"https://api.github.com/users/jpages/gists{/gist_id}","starred_url":"https://api.github.com/users/jpages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpages/subscriptions","organizations_url":"https://api.github.com/users/jpages/orgs","repos_url":"https://api.github.com/users/jpages/repos","events_url":"https://api.github.com/users/jpages/events{/privacy}","received_events_url":"https://api.github.com/users/jpages/received_events","type":"User","site_admin":false},"body":"This PR fixes a bug that was hidden in the nitvm for a too long time, the recursion in class loading was bad and is now corrected.\r\n\r\nThen a more accurate mechanism is introduce to deal with positions of methods and attributes in internal structures of classes and objects.\r\nWhen a method dispatch is performed, this mechanism allows to ask precisely for a class the position of a block of methods (or attributes). This should increase the proportion of object mechanisms \"compiled\" in an efficient way.\r\n\r\nFinally, the class loading is optimized: an indirectly loaded class is not fully constructed and allocated.\r\nInstead, its identifier is computed to allow subtyping tests.\r\n\r\nFor now, these more accurate mechanisms need recompilations of callsite. This sould be done in further PR.","created_at":"2015-05-26T13:52:21Z","updated_at":"2015-05-26T18:16:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27e79870c46f455a47a740bfe216fb72c794bdd0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/privat/nit/pulls/1398/commits","review_comments_url":"https://api.github.com/repos/privat/nit/pulls/1398/comments","review_comment_url":"https://api.github.com/repos/privat/nit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/privat/nit/issues/1398/comments","statuses_url":"https://api.github.com/repos/privat/nit/statuses/2ac2b09e11f7eccc58db6e1ea401df8e77215048","head":{"label":"jpages:nitvm","ref":"nitvm","sha":"2ac2b09e11f7eccc58db6e1ea401df8e77215048","user":{"login":"jpages","id":2535352,"avatar_url":"https://avatars.githubusercontent.com/u/2535352?v=3","gravatar_id":"","url":"https://api.github.com/users/jpages","html_url":"https://github.com/jpages","followers_url":"https://api.github.com/users/jpages/followers","following_url":"https://api.github.com/users/jpages/following{/other_user}","gists_url":"https://api.github.com/users/jpages/gists{/gist_id}","starred_url":"https://api.github.com/users/jpages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpages/subscriptions","organizations_url":"https://api.github.com/users/jpages/orgs","repos_url":"https://api.github.com/users/jpages/repos","events_url":"https://api.github.com/users/jpages/events{/privacy}","received_events_url":"https://api.github.com/users/jpages/received_events","type":"User","site_admin":false},"repo":{"id":19516956,"name":"nit","full_name":"jpages/nit","owner":{"login":"jpages","id":2535352,"avatar_url":"https://avatars.githubusercontent.com/u/2535352?v=3","gravatar_id":"","url":"https://api.github.com/users/jpages","html_url":"https://github.com/jpages","followers_url":"https://api.github.com/users/jpages/followers","following_url":"https://api.github.com/users/jpages/following{/other_user}","gists_url":"https://api.github.com/users/jpages/gists{/gist_id}","starred_url":"https://api.github.com/users/jpages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpages/subscriptions","organizations_url":"https://api.github.com/users/jpages/orgs","repos_url":"https://api.github.com/users/jpages/repos","events_url":"https://api.github.com/users/jpages/events{/privacy}","received_events_url":"https://api.github.com/users/jpages/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jpages/nit","description":"Nit language","fork":true,"url":"https://api.github.com/repos/jpages/nit","forks_url":"https://api.github.com/repos/jpages/nit/forks","keys_url":"https://api.github.com/repos/jpages/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jpages/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jpages/nit/teams","hooks_url":"https://api.github.com/repos/jpages/nit/hooks","issue_events_url":"https://api.github.com/repos/jpages/nit/issues/events{/number}","events_url":"https://api.github.com/repos/jpages/nit/events","assignees_url":"https://api.github.com/repos/jpages/nit/assignees{/user}","branches_url":"https://api.github.com/repos/jpages/nit/branches{/branch}","tags_url":"https://api.github.com/repos/jpages/nit/tags","blobs_url":"https://api.github.com/repos/jpages/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jpages/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jpages/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/jpages/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jpages/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/jpages/nit/languages","stargazers_url":"https://api.github.com/repos/jpages/nit/stargazers","contributors_url":"https://api.github.com/repos/jpages/nit/contributors","subscribers_url":"https://api.github.com/repos/jpages/nit/subscribers","subscription_url":"https://api.github.com/repos/jpages/nit/subscription","commits_url":"https://api.github.com/repos/jpages/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/jpages/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/jpages/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/jpages/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/jpages/nit/contents/{+path}","compare_url":"https://api.github.com/repos/jpages/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jpages/nit/merges","archive_url":"https://api.github.com/repos/jpages/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jpages/nit/downloads","issues_url":"https://api.github.com/repos/jpages/nit/issues{/number}","pulls_url":"https://api.github.com/repos/jpages/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/jpages/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/jpages/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jpages/nit/labels{/name}","releases_url":"https://api.github.com/repos/jpages/nit/releases{/id}","created_at":"2014-05-07T01:32:41Z","updated_at":"2015-04-16T13:10:51Z","pushed_at":"2015-05-26T13:38:18Z","git_url":"git://github.com/jpages/nit.git","ssh_url":"git@github.com:jpages/nit.git","clone_url":"https://github.com/jpages/nit.git","svn_url":"https://github.com/jpages/nit","homepage":"http://nitlanguage.org","size":60424,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"privat:master","ref":"master","sha":"52ecf977412e09bbee42bcf7b4268c393e9a8a3e","user":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"repo":{"id":328597,"name":"nit","full_name":"privat/nit","owner":{"login":"privat","id":135828,"avatar_url":"https://avatars.githubusercontent.com/u/135828?v=3","gravatar_id":"","url":"https://api.github.com/users/privat","html_url":"https://github.com/privat","followers_url":"https://api.github.com/users/privat/followers","following_url":"https://api.github.com/users/privat/following{/other_user}","gists_url":"https://api.github.com/users/privat/gists{/gist_id}","starred_url":"https://api.github.com/users/privat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privat/subscriptions","organizations_url":"https://api.github.com/users/privat/orgs","repos_url":"https://api.github.com/users/privat/repos","events_url":"https://api.github.com/users/privat/events{/privacy}","received_events_url":"https://api.github.com/users/privat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/privat/nit","description":"Nit language","fork":false,"url":"https://api.github.com/repos/privat/nit","forks_url":"https://api.github.com/repos/privat/nit/forks","keys_url":"https://api.github.com/repos/privat/nit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privat/nit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privat/nit/teams","hooks_url":"https://api.github.com/repos/privat/nit/hooks","issue_events_url":"https://api.github.com/repos/privat/nit/issues/events{/number}","events_url":"https://api.github.com/repos/privat/nit/events","assignees_url":"https://api.github.com/repos/privat/nit/assignees{/user}","branches_url":"https://api.github.com/repos/privat/nit/branches{/branch}","tags_url":"https://api.github.com/repos/privat/nit/tags","blobs_url":"https://api.github.com/repos/privat/nit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privat/nit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privat/nit/git/refs{/sha}","trees_url":"https://api.github.com/repos/privat/nit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privat/nit/statuses/{sha}","languages_url":"https://api.github.com/repos/privat/nit/languages","stargazers_url":"https://api.github.com/repos/privat/nit/stargazers","contributors_url":"https://api.github.com/repos/privat/nit/contributors","subscribers_url":"https://api.github.com/repos/privat/nit/subscribers","subscription_url":"https://api.github.com/repos/privat/nit/subscription","commits_url":"https://api.github.com/repos/privat/nit/commits{/sha}","git_commits_url":"https://api.github.com/repos/privat/nit/git/commits{/sha}","comments_url":"https://api.github.com/repos/privat/nit/comments{/number}","issue_comment_url":"https://api.github.com/repos/privat/nit/issues/comments{/number}","contents_url":"https://api.github.com/repos/privat/nit/contents/{+path}","compare_url":"https://api.github.com/repos/privat/nit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privat/nit/merges","archive_url":"https://api.github.com/repos/privat/nit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privat/nit/downloads","issues_url":"https://api.github.com/repos/privat/nit/issues{/number}","pulls_url":"https://api.github.com/repos/privat/nit/pulls{/number}","milestones_url":"https://api.github.com/repos/privat/nit/milestones{/number}","notifications_url":"https://api.github.com/repos/privat/nit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privat/nit/labels{/name}","releases_url":"https://api.github.com/repos/privat/nit/releases{/id}","created_at":"2009-10-06T15:03:00Z","updated_at":"2015-05-21T14:04:08Z","pushed_at":"2015-05-26T17:53:06Z","git_url":"git://github.com/privat/nit.git","ssh_url":"git@github.com:privat/nit.git","clone_url":"https://github.com/privat/nit.git","svn_url":"https://github.com/privat/nit","homepage":"http://nitlanguage.org","size":87983,"stargazers_count":68,"watchers_count":68,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":135,"forks":41,"open_issues":135,"watchers":68,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/privat/nit/pulls/1398"},"html":{"href":"https://github.com/privat/nit/pull/1398"},"issue":{"href":"https://api.github.com/repos/privat/nit/issues/1398"},"comments":{"href":"https://api.github.com/repos/privat/nit/issues/1398/comments"},"review_comments":{"href":"https://api.github.com/repos/privat/nit/pulls/1398/comments"},"review_comment":{"href":"https://api.github.com/repos/privat/nit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/privat/nit/pulls/1398/commits"},"statuses":{"href":"https://api.github.com/repos/privat/nit/statuses/2ac2b09e11f7eccc58db6e1ea401df8e77215048"}}}}