{"action":"created","comment":{"url":"https://api.github.com/repos/ethereum/solidity/pulls/comments/174142921","pull_request_review_id":103443895,"id":174142921,"diff_hunk":"@@ -338,14 +341,33 @@ void CompilerUtils::abiDecodeV2(TypePointers const& _parameterTypes, bool _fromM\n \n void CompilerUtils::zeroInitialiseMemoryArray(ArrayType const& _type)\n {\n-\tauto repeat = m_context.newTag();\n-\tm_context << repeat;\n-\tpushZeroValue(*_type.baseType());\n-\tstoreInMemoryDynamic(*_type.baseType());\n-\tm_context << Instruction::SWAP1 << u256(1) << Instruction::SWAP1;\n-\tm_context << Instruction::SUB << Instruction::SWAP1;\n-\tm_context << Instruction::DUP2;\n-\tm_context.appendConditionalJumpTo(repeat);\n+\tif (_type.baseType()->hasSimpleZeroValueInMemory())\n+\t{\n+\t\tsolAssert(_type.baseType()->isValueType(), \"\");\n+\t\tWhiskers templ(R\"({\n+\t\t\tlet size := mul(length, <element_size>)\n+\t\t\tcalldatacopy(memptr, calldatasize(), size)","path":"libsolidity/codegen/CompilerUtils.cpp","position":33,"original_position":33,"commit_id":"5f4cfcc0574ac7e7b916c7bfad65e1744d9584f9","original_commit_id":"6302ba3ab989676a808320342f9fdaa942285c9c","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars2.githubusercontent.com/u/9073706?v=4","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"body":"I think it is the cheapest way to do it.","created_at":"2018-03-13T14:07:25Z","updated_at":"2018-03-13T14:07:25Z","html_url":"https://github.com/ethereum/solidity/pull/3693#discussion_r174142921","pull_request_url":"https://api.github.com/repos/ethereum/solidity/pulls/3693","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/comments/174142921"},"html":{"href":"https://github.com/ethereum/solidity/pull/3693#discussion_r174142921"},"pull_request":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/3693"}},"in_reply_to_id":174133384},"pull_request":{"url":"https://api.github.com/repos/ethereum/solidity/pulls/3693","id":173817248,"html_url":"https://github.com/ethereum/solidity/pull/3693","diff_url":"https://github.com/ethereum/solidity/pull/3693.diff","patch_url":"https://github.com/ethereum/solidity/pull/3693.patch","issue_url":"https://api.github.com/repos/ethereum/solidity/issues/3693","number":3693,"state":"open","locked":false,"title":"Optimize across MLOAD if MSIZE is not used.","user":{"login":"chriseth","id":9073706,"avatar_url":"https://avatars2.githubusercontent.com/u/9073706?v=4","gravatar_id":"","url":"https://api.github.com/users/chriseth","html_url":"https://github.com/chriseth","followers_url":"https://api.github.com/users/chriseth/followers","following_url":"https://api.github.com/users/chriseth/following{/other_user}","gists_url":"https://api.github.com/users/chriseth/gists{/gist_id}","starred_url":"https://api.github.com/users/chriseth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriseth/subscriptions","organizations_url":"https://api.github.com/users/chriseth/orgs","repos_url":"https://api.github.com/users/chriseth/repos","events_url":"https://api.github.com/users/chriseth/events{/privacy}","received_events_url":"https://api.github.com/users/chriseth/received_events","type":"User","site_admin":false},"body":"Fixes #3691 and #3688 \r\n\r\nThanks to @figs999 for noticing these problems with the optimizer!\r\n\r\nTODO:\r\n\r\n - [x] tests\r\n - [x] ~~create multidimensional arrays more efficiently~~ (will do in separate PR)","created_at":"2018-03-08T18:43:59Z","updated_at":"2018-03-13T14:07:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cac2bc3dcf23a3554f839711bb0900f2e6689d3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":838064207,"url":"https://api.github.com/repos/ethereum/solidity/labels/annoys%20users","name":"annoys users","color":"ea2cab","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/solidity/pulls/3693/commits","review_comments_url":"https://api.github.com/repos/ethereum/solidity/pulls/3693/comments","review_comment_url":"https://api.github.com/repos/ethereum/solidity/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/solidity/issues/3693/comments","statuses_url":"https://api.github.com/repos/ethereum/solidity/statuses/5f4cfcc0574ac7e7b916c7bfad65e1744d9584f9","head":{"label":"ethereum:optimizeMLOAD","ref":"optimizeMLOAD","sha":"5f4cfcc0574ac7e7b916c7bfad65e1744d9584f9","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":40892817,"name":"solidity","full_name":"ethereum/solidity","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/solidity","description":"The Solidity Contract-Oriented Programming Language","fork":false,"url":"https://api.github.com/repos/ethereum/solidity","forks_url":"https://api.github.com/repos/ethereum/solidity/forks","keys_url":"https://api.github.com/repos/ethereum/solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/solidity/teams","hooks_url":"https://api.github.com/repos/ethereum/solidity/hooks","issue_events_url":"https://api.github.com/repos/ethereum/solidity/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/solidity/events","assignees_url":"https://api.github.com/repos/ethereum/solidity/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/solidity/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/solidity/tags","blobs_url":"https://api.github.com/repos/ethereum/solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/solidity/languages","stargazers_url":"https://api.github.com/repos/ethereum/solidity/stargazers","contributors_url":"https://api.github.com/repos/ethereum/solidity/contributors","subscribers_url":"https://api.github.com/repos/ethereum/solidity/subscribers","subscription_url":"https://api.github.com/repos/ethereum/solidity/subscription","commits_url":"https://api.github.com/repos/ethereum/solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/solidity/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/solidity/merges","archive_url":"https://api.github.com/repos/ethereum/solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/solidity/downloads","issues_url":"https://api.github.com/repos/ethereum/solidity/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/solidity/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/solidity/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/solidity/deployments","created_at":"2015-08-17T12:27:26Z","updated_at":"2018-03-13T13:43:03Z","pushed_at":"2018-03-13T14:05:55Z","git_url":"git://github.com/ethereum/solidity.git","ssh_url":"git@github.com:ethereum/solidity.git","clone_url":"https://github.com/ethereum/solidity.git","svn_url":"https://github.com/ethereum/solidity","homepage":"","size":18095,"stargazers_count":4013,"watchers_count":4013,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1073,"mirror_url":null,"archived":false,"open_issues_count":546,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1073,"open_issues":546,"watchers":4013,"default_branch":"develop"}},"base":{"label":"ethereum:develop","ref":"develop","sha":"f2614be95f71a274db3c172661726dd007e90cf7","user":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":40892817,"name":"solidity","full_name":"ethereum/solidity","owner":{"login":"ethereum","id":6250754,"avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/solidity","description":"The Solidity Contract-Oriented Programming Language","fork":false,"url":"https://api.github.com/repos/ethereum/solidity","forks_url":"https://api.github.com/repos/ethereum/solidity/forks","keys_url":"https://api.github.com/repos/ethereum/solidity/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/solidity/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/solidity/teams","hooks_url":"https://api.github.com/repos/ethereum/solidity/hooks","issue_events_url":"https://api.github.com/repos/ethereum/solidity/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/solidity/events","assignees_url":"https://api.github.com/repos/ethereum/solidity/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/solidity/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/solidity/tags","blobs_url":"https://api.github.com/repos/ethereum/solidity/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/solidity/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/solidity/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/solidity/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/solidity/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/solidity/languages","stargazers_url":"https://api.github.com/repos/ethereum/solidity/stargazers","contributors_url":"https://api.github.com/repos/ethereum/solidity/contributors","subscribers_url":"https://api.github.com/repos/ethereum/solidity/subscribers","subscription_url":"https://api.github.com/repos/ethereum/solidity/subscription","commits_url":"https://api.github.com/repos/ethereum/solidity/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/solidity/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/solidity/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/solidity/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/solidity/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/solidity/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/solidity/merges","archive_url":"https://api.github.com/repos/ethereum/solidity/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/solidity/downloads","issues_url":"https://api.github.com/repos/ethereum/solidity/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/solidity/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/solidity/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/solidity/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/solidity/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/solidity/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/solidity/deployments","created_at":"2015-08-17T12:27:26Z","updated_at":"2018-03-13T13:43:03Z","pushed_at":"2018-03-13T14:05:55Z","git_url":"git://github.com/ethereum/solidity.git","ssh_url":"git@github.com:ethereum/solidity.git","clone_url":"https://github.com/ethereum/solidity.git","svn_url":"https://github.com/ethereum/solidity","homepage":"","size":18095,"stargazers_count":4013,"watchers_count":4013,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1073,"mirror_url":null,"archived":false,"open_issues_count":546,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":1073,"open_issues":546,"watchers":4013,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/3693"},"html":{"href":"https://github.com/ethereum/solidity/pull/3693"},"issue":{"href":"https://api.github.com/repos/ethereum/solidity/issues/3693"},"comments":{"href":"https://api.github.com/repos/ethereum/solidity/issues/3693/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/3693/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/solidity/pulls/3693/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/solidity/statuses/5f4cfcc0574ac7e7b916c7bfad65e1744d9584f9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chriseth"}}