{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments/81425332","pull_request_review_id":2409176,"id":81425332,"diff_hunk":"@@ -322,8 +322,8 @@ EXDEF2    (EMPTY,                   ChkNewCallFlag,             OP_ChkNewCallFla\n EXDEF3_WMS(CUSTOM_L_Value,          NewInnerStackScFunc,        OP_NewInnerStackScFunc, ElementSlot)\n EXDEF2_WMS(GET_ELEM_SLOT_FB,        NewInnerScFunc,             ScriptFunction::OP_NewScFunc)\n EXDEF2_WMS(GET_ELEM_SLOT_FB,        NewInnerScGenFunc,          JavascriptGeneratorFunction::OP_NewScGenFunc)\n-  DEF2_WMS(A1toA1MemNonVar,         GetForInEnumerator,         JavascriptOperators::OP_GetForInEnumerator)\n-  DEF3_WMS(A1toXXMemNonVar,         ReleaseForInEnumerator,     JavascriptOperators::OP_ReleaseForInEnumerator, ForInObjectEnumerator *)\n+  DEF2_WMS(A1U1toXX,                InitForInEnumerator,        OP_InitForInEnumerator)\n+  DEF2_WMS(A1U1toXXWitCache,        ProfiledInitForInEnumerator,OP_InitForInEnumeratorWithCache)","path":"lib/Runtime/Language/InterpreterHandler.inl","position":7,"original_position":7,"commit_id":"c5006e2e7b8c9be9a6815282d40f98795aeb2044","original_commit_id":"c5006e2e7b8c9be9a6815282d40f98795aeb2044","user":{"login":"rajatd","id":15348123,"avatar_url":"https://avatars.githubusercontent.com/u/15348123?v=3","gravatar_id":"","url":"https://api.github.com/users/rajatd","html_url":"https://github.com/rajatd","followers_url":"https://api.github.com/users/rajatd/followers","following_url":"https://api.github.com/users/rajatd/following{/other_user}","gists_url":"https://api.github.com/users/rajatd/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatd/subscriptions","organizations_url":"https://api.github.com/users/rajatd/orgs","repos_url":"https://api.github.com/users/rajatd/repos","events_url":"https://api.github.com/users/rajatd/events{/privacy}","received_events_url":"https://api.github.com/users/rajatd/received_events","type":"User","site_admin":false},"body":">A1U1toXXWitCache [](start = 11, length = 16)\r\n\r\nchange Wit to With.","created_at":"2016-09-30T22:00:41Z","updated_at":"2016-09-30T22:00:41Z","html_url":"https://github.com/Microsoft/ChakraCore/pull/1641#discussion_r81425332","pull_request_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/1641","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments/81425332"},"html":{"href":"https://github.com/Microsoft/ChakraCore/pull/1641#discussion_r81425332"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/1641"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/1641","id":86757794,"html_url":"https://github.com/Microsoft/ChakraCore/pull/1641","diff_url":"https://github.com/Microsoft/ChakraCore/pull/1641.diff","patch_url":"https://github.com/Microsoft/ChakraCore/pull/1641.patch","issue_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/1641","number":1641,"state":"open","locked":false,"title":"Optimizating ForInObjectEnumerator overhead","user":{"login":"curtisman","id":12101885,"avatar_url":"https://avatars.githubusercontent.com/u/12101885?v=3","gravatar_id":"","url":"https://api.github.com/users/curtisman","html_url":"https://github.com/curtisman","followers_url":"https://api.github.com/users/curtisman/followers","following_url":"https://api.github.com/users/curtisman/following{/other_user}","gists_url":"https://api.github.com/users/curtisman/gists{/gist_id}","starred_url":"https://api.github.com/users/curtisman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curtisman/subscriptions","organizations_url":"https://api.github.com/users/curtisman/orgs","repos_url":"https://api.github.com/users/curtisman/repos","events_url":"https://api.github.com/users/curtisman/events{/privacy}","received_events_url":"https://api.github.com/users/curtisman/received_events","type":"User","site_admin":false},"body":"The overhead for ForInObjectEnumerator can become significant if we enumerate a lot of object with small number of properties.\r\n\r\nThis change improves Sunspider by about 3.5ms (or 1.6%) and Speedometer by about 60ms (or 0.6%) on my machine.\r\nNo change on Octane or Kraken.\r\n\r\n1.  Allocate ForInObjectEnumerator on the stack instead of dynamically\r\n  - Keep track of the maximum for..in loop depth at byte code generation.\r\n  - Change the for..in byte code to InitForInEnumerator and BrOnEmpty to refer to the for..in loop depth\r\n  - Allocate stack space for the ForInObjectEnumerator for interpreter and JIT'ed code.\r\n  - When bailing out of JIT'ed code, the bailout interpreter frame will not allocate new stack space for the ForInObjectEnumerator, but instead reuse the space allocated on the JIT'ed frame.\r\n  - When we are in JIT loop body, it also won't allocate new ForInObjectEnumerator. the loop body code will instead refer to the ForInObjectEnumerator allocated in the interpreter frame.\r\n  - In JIT inlining, we need to keep track of inlinee for..in loop depth as well to allocate enough space for all of them.\r\n\r\n2. Reduce the size of ForInObjectEnumerator\r\n  - Remove scriptContext and flags fields in ForInObjectEnumerator by reusing the same fields in DynamicObjectPropertyEnumerator and always initializing those.\r\n  - Move all the fields needed to keep track of properties shadowing in prototypes into a dynamically allocated structure.  We already needed to allocate the sparse bit vector before already, so this is not a new allocation, but it will minimize stack usage for cases that doesn't have enumerable properties on the prototype.\r\n\r\n3. Add inline cache that maps the object type to DynamicObjectPropertyEnumerator::CacheData on InitForInEnumerator\r\n  - The cache is pass to all GetEnumerator API to be given to DynamicObjectPropertyEnumerator to avoid the dictionary look up\r\n  - Since we clear the type to cache data map on every GC, we also clear the inline cache on every GC as well.\r\n\r\n4. Implemented JIT fast path for OP_InitForInEnumerator and improved JIT fast path for BrOnEmpty\r\n  - Implemented the OP_InitForInEnumerator when we have an inline cache match, with a plain dynamic object, doesn't have enumerable property on the prototype and doesn't index properties (object array)\r\n  - Instead of checking multiple conditions, initialize a single bool on ForInObjectEnumerator canUseJITFastPath to indicate whether we can use the fast path, that combines the check for no prefix/array enumerator, no enumerable property on the prototype and have cache data\r\n  - Avoid going to the helper before we exit the loop by adding a loop exit check for whether the cache is complete at the end of the enumeration\r\n  - If prototype doesn't have any enumerable property, we don't have to keep track of shadowing.  So just ask the object enumerator to return enumerable property only, so that the for in object enumerator and the jit fast path doesn't have to check whether the property is enumerable or not.\r\n\r\n5. Minor cleanup\r\n  - Delete JavascriptEnumeratorIterator, which is no longer used.\r\n  - Refactor code in the backend to add loop in lower\r\n","created_at":"2016-09-26T14:52:40Z","updated_at":"2016-09-30T22:00:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ce41c241e593fc107d4b3957a4242a49f61cffd","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/1641/commits","review_comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/1641/comments","review_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/1641/comments","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/c5006e2e7b8c9be9a6815282d40f98795aeb2044","head":{"label":"curtisman:forin","ref":"forin","sha":"c5006e2e7b8c9be9a6815282d40f98795aeb2044","user":{"login":"curtisman","id":12101885,"avatar_url":"https://avatars.githubusercontent.com/u/12101885?v=3","gravatar_id":"","url":"https://api.github.com/users/curtisman","html_url":"https://github.com/curtisman","followers_url":"https://api.github.com/users/curtisman/followers","following_url":"https://api.github.com/users/curtisman/following{/other_user}","gists_url":"https://api.github.com/users/curtisman/gists{/gist_id}","starred_url":"https://api.github.com/users/curtisman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curtisman/subscriptions","organizations_url":"https://api.github.com/users/curtisman/orgs","repos_url":"https://api.github.com/users/curtisman/repos","events_url":"https://api.github.com/users/curtisman/events{/privacy}","received_events_url":"https://api.github.com/users/curtisman/received_events","type":"User","site_admin":false},"repo":{"id":49592468,"name":"ChakraCore","full_name":"curtisman/ChakraCore","owner":{"login":"curtisman","id":12101885,"avatar_url":"https://avatars.githubusercontent.com/u/12101885?v=3","gravatar_id":"","url":"https://api.github.com/users/curtisman","html_url":"https://github.com/curtisman","followers_url":"https://api.github.com/users/curtisman/followers","following_url":"https://api.github.com/users/curtisman/following{/other_user}","gists_url":"https://api.github.com/users/curtisman/gists{/gist_id}","starred_url":"https://api.github.com/users/curtisman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/curtisman/subscriptions","organizations_url":"https://api.github.com/users/curtisman/orgs","repos_url":"https://api.github.com/users/curtisman/repos","events_url":"https://api.github.com/users/curtisman/events{/privacy}","received_events_url":"https://api.github.com/users/curtisman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/curtisman/ChakraCore","description":"ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge","fork":true,"url":"https://api.github.com/repos/curtisman/ChakraCore","forks_url":"https://api.github.com/repos/curtisman/ChakraCore/forks","keys_url":"https://api.github.com/repos/curtisman/ChakraCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/curtisman/ChakraCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/curtisman/ChakraCore/teams","hooks_url":"https://api.github.com/repos/curtisman/ChakraCore/hooks","issue_events_url":"https://api.github.com/repos/curtisman/ChakraCore/issues/events{/number}","events_url":"https://api.github.com/repos/curtisman/ChakraCore/events","assignees_url":"https://api.github.com/repos/curtisman/ChakraCore/assignees{/user}","branches_url":"https://api.github.com/repos/curtisman/ChakraCore/branches{/branch}","tags_url":"https://api.github.com/repos/curtisman/ChakraCore/tags","blobs_url":"https://api.github.com/repos/curtisman/ChakraCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/curtisman/ChakraCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/curtisman/ChakraCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/curtisman/ChakraCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/curtisman/ChakraCore/statuses/{sha}","languages_url":"https://api.github.com/repos/curtisman/ChakraCore/languages","stargazers_url":"https://api.github.com/repos/curtisman/ChakraCore/stargazers","contributors_url":"https://api.github.com/repos/curtisman/ChakraCore/contributors","subscribers_url":"https://api.github.com/repos/curtisman/ChakraCore/subscribers","subscription_url":"https://api.github.com/repos/curtisman/ChakraCore/subscription","commits_url":"https://api.github.com/repos/curtisman/ChakraCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/curtisman/ChakraCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/curtisman/ChakraCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/curtisman/ChakraCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/curtisman/ChakraCore/contents/{+path}","compare_url":"https://api.github.com/repos/curtisman/ChakraCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/curtisman/ChakraCore/merges","archive_url":"https://api.github.com/repos/curtisman/ChakraCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/curtisman/ChakraCore/downloads","issues_url":"https://api.github.com/repos/curtisman/ChakraCore/issues{/number}","pulls_url":"https://api.github.com/repos/curtisman/ChakraCore/pulls{/number}","milestones_url":"https://api.github.com/repos/curtisman/ChakraCore/milestones{/number}","notifications_url":"https://api.github.com/repos/curtisman/ChakraCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/curtisman/ChakraCore/labels{/name}","releases_url":"https://api.github.com/repos/curtisman/ChakraCore/releases{/id}","deployments_url":"https://api.github.com/repos/curtisman/ChakraCore/deployments","created_at":"2016-01-13T18:14:28Z","updated_at":"2016-01-13T22:37:01Z","pushed_at":"2016-09-30T18:17:13Z","git_url":"git://github.com/curtisman/ChakraCore.git","ssh_url":"git@github.com:curtisman/ChakraCore.git","clone_url":"https://github.com/curtisman/ChakraCore.git","svn_url":"https://github.com/curtisman/ChakraCore","homepage":null,"size":37803,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"b45e179dc58c901b1796fde44ea5a1503a6b7cb8","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":49086513,"name":"ChakraCore","full_name":"Microsoft/ChakraCore","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/ChakraCore","description":"ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge","fork":false,"url":"https://api.github.com/repos/Microsoft/ChakraCore","forks_url":"https://api.github.com/repos/Microsoft/ChakraCore/forks","keys_url":"https://api.github.com/repos/Microsoft/ChakraCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/ChakraCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/ChakraCore/teams","hooks_url":"https://api.github.com/repos/Microsoft/ChakraCore/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/events","assignees_url":"https://api.github.com/repos/Microsoft/ChakraCore/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/ChakraCore/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/tags","blobs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/ChakraCore/languages","stargazers_url":"https://api.github.com/repos/Microsoft/ChakraCore/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/ChakraCore/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscription","commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/ChakraCore/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/ChakraCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/ChakraCore/merges","archive_url":"https://api.github.com/repos/Microsoft/ChakraCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/ChakraCore/downloads","issues_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/ChakraCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/ChakraCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/ChakraCore/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/ChakraCore/deployments","created_at":"2016-01-05T19:05:31Z","updated_at":"2016-09-30T16:51:55Z","pushed_at":"2016-09-30T21:19:12Z","git_url":"git://github.com/Microsoft/ChakraCore.git","ssh_url":"git@github.com:Microsoft/ChakraCore.git","clone_url":"https://github.com/Microsoft/ChakraCore.git","svn_url":"https://github.com/Microsoft/ChakraCore","homepage":null,"size":52393,"stargazers_count":5686,"watchers_count":5686,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":634,"mirror_url":null,"open_issues_count":167,"forks":634,"open_issues":167,"watchers":5686,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/1641"},"html":{"href":"https://github.com/Microsoft/ChakraCore/pull/1641"},"issue":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/issues/1641"},"comments":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/issues/1641/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/1641/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/1641/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/c5006e2e7b8c9be9a6815282d40f98795aeb2044"}}}}
{"actor":{"display_login":"rajatd"}}