{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/55504751","id":55504751,"diff_hunk":"@@ -452,12 +453,12 @@ static const re_compiled_code_t *re_cache[RE_CACHE_SIZE];\n  * @return compiled bytecode - if found\n  *         NULL              - otherwise\n  */\n-const re_compiled_code_t *\n+static const re_compiled_code_t *\n re_find_bytecode_in_cache (ecma_string_t *pattern_str_p, /**< pattern string */\n                            uint16_t flags, /**< flags */\n-                           uint32_t *idx) /**< [out] index */\n+                           uint16_t *idx) /**< [out] index */","path":"jerry-core/parser/regexp/re-compiler.c","position":17,"original_position":17,"commit_id":"7891675d7088aecc9b851b8753628757b90b5e2a","original_commit_id":"7891675d7088aecc9b851b8753628757b90b5e2a","user":{"login":"akiss77","id":9976482,"avatar_url":"https://avatars.githubusercontent.com/u/9976482?v=3","gravatar_id":"","url":"https://api.github.com/users/akiss77","html_url":"https://github.com/akiss77","followers_url":"https://api.github.com/users/akiss77/followers","following_url":"https://api.github.com/users/akiss77/following{/other_user}","gists_url":"https://api.github.com/users/akiss77/gists{/gist_id}","starred_url":"https://api.github.com/users/akiss77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akiss77/subscriptions","organizations_url":"https://api.github.com/users/akiss77/orgs","repos_url":"https://api.github.com/users/akiss77/repos","events_url":"https://api.github.com/users/akiss77/events{/privacy}","received_events_url":"https://api.github.com/users/akiss77/received_events","type":"User","site_admin":false},"body":"I've reviewed this function and its call site in `re_compile_bytecode` and I'm wondering whether the complexity of its signature is really needed. Wouldn't \r\n`static uin16_t re_find_bytecode_in_cache (ecma_string_t *pattern_str_p, uint16_t flags)`\r\nsuffice? \r\n\r\nWith the following semantics: if the returned value equals `RE_CACHE_SIZE`, then the pattern was not found in the cache and also there is no free slot in the cache; if the returned value is a valid index and the corresponding slot in the cache is `NULL`, then the pattern was not found but index points to a free slot; finally, if the index is valid and the slot is non-NULL, then that's the bytecode we looked for.\r\n\r\nThis would eliminate the need for the out parameter, i.e., a pointer to a short int, which is quite often dereferenced in a loop in the body of the function.","created_at":"2016-03-09T11:22:16Z","updated_at":"2016-03-09T11:22:16Z","html_url":"https://github.com/Samsung/jerryscript/pull/947#discussion_r55504751","pull_request_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/947","_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/55504751"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/947#discussion_r55504751"},"pull_request":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/947"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/947","id":62209367,"html_url":"https://github.com/Samsung/jerryscript/pull/947","diff_url":"https://github.com/Samsung/jerryscript/pull/947.diff","patch_url":"https://github.com/Samsung/jerryscript/pull/947.patch","issue_url":"https://api.github.com/repos/Samsung/jerryscript/issues/947","number":947,"state":"open","locked":false,"title":"Few improvements for RegExp","user":{"login":"LaszloLango","id":10030017,"avatar_url":"https://avatars.githubusercontent.com/u/10030017?v=3","gravatar_id":"","url":"https://api.github.com/users/LaszloLango","html_url":"https://github.com/LaszloLango","followers_url":"https://api.github.com/users/LaszloLango/followers","following_url":"https://api.github.com/users/LaszloLango/following{/other_user}","gists_url":"https://api.github.com/users/LaszloLango/gists{/gist_id}","starred_url":"https://api.github.com/users/LaszloLango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaszloLango/subscriptions","organizations_url":"https://api.github.com/users/LaszloLango/orgs","repos_url":"https://api.github.com/users/LaszloLango/repos","events_url":"https://api.github.com/users/LaszloLango/events{/privacy}","received_events_url":"https://api.github.com/users/LaszloLango/received_events","type":"User","site_admin":false},"body":"Added eviction mechanism to RegExp cache and small\r\nrefactoring. Fixed a bug when logging is enabled.\r\n\r\nRelated issue: #927\r\n\r\nJerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com","created_at":"2016-03-09T10:42:29Z","updated_at":"2016-03-09T11:22:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1bc2e841b7d3c4d0e9d733d941bc4a32265dc4e1","assignee":null,"milestone":{"url":"https://api.github.com/repos/Samsung/jerryscript/milestones/4","html_url":"https://github.com/Samsung/jerryscript/milestones/Engine%20optimization%20&%20enhancement","labels_url":"https://api.github.com/repos/Samsung/jerryscript/milestones/4/labels","id":1188990,"number":4,"title":"Engine optimization & enhancement","description":"","creator":{"login":"egavrin","id":782710,"avatar_url":"https://avatars.githubusercontent.com/u/782710?v=3","gravatar_id":"","url":"https://api.github.com/users/egavrin","html_url":"https://github.com/egavrin","followers_url":"https://api.github.com/users/egavrin/followers","following_url":"https://api.github.com/users/egavrin/following{/other_user}","gists_url":"https://api.github.com/users/egavrin/gists{/gist_id}","starred_url":"https://api.github.com/users/egavrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egavrin/subscriptions","organizations_url":"https://api.github.com/users/egavrin/orgs","repos_url":"https://api.github.com/users/egavrin/repos","events_url":"https://api.github.com/users/egavrin/events{/privacy}","received_events_url":"https://api.github.com/users/egavrin/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":123,"state":"open","created_at":"2015-07-01T13:22:04Z","updated_at":"2016-03-09T10:42:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/947/commits","review_comments_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/947/comments","review_comment_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/issues/947/comments","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/7891675d7088aecc9b851b8753628757b90b5e2a","head":{"label":"LaszloLango:improve-regexp-cache","ref":"improve-regexp-cache","sha":"7891675d7088aecc9b851b8753628757b90b5e2a","user":{"login":"LaszloLango","id":10030017,"avatar_url":"https://avatars.githubusercontent.com/u/10030017?v=3","gravatar_id":"","url":"https://api.github.com/users/LaszloLango","html_url":"https://github.com/LaszloLango","followers_url":"https://api.github.com/users/LaszloLango/followers","following_url":"https://api.github.com/users/LaszloLango/following{/other_user}","gists_url":"https://api.github.com/users/LaszloLango/gists{/gist_id}","starred_url":"https://api.github.com/users/LaszloLango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaszloLango/subscriptions","organizations_url":"https://api.github.com/users/LaszloLango/orgs","repos_url":"https://api.github.com/users/LaszloLango/repos","events_url":"https://api.github.com/users/LaszloLango/events{/privacy}","received_events_url":"https://api.github.com/users/LaszloLango/received_events","type":"User","site_admin":false},"repo":{"id":38432323,"name":"jerryscript","full_name":"LaszloLango/jerryscript","owner":{"login":"LaszloLango","id":10030017,"avatar_url":"https://avatars.githubusercontent.com/u/10030017?v=3","gravatar_id":"","url":"https://api.github.com/users/LaszloLango","html_url":"https://github.com/LaszloLango","followers_url":"https://api.github.com/users/LaszloLango/followers","following_url":"https://api.github.com/users/LaszloLango/following{/other_user}","gists_url":"https://api.github.com/users/LaszloLango/gists{/gist_id}","starred_url":"https://api.github.com/users/LaszloLango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaszloLango/subscriptions","organizations_url":"https://api.github.com/users/LaszloLango/orgs","repos_url":"https://api.github.com/users/LaszloLango/repos","events_url":"https://api.github.com/users/LaszloLango/events{/privacy}","received_events_url":"https://api.github.com/users/LaszloLango/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LaszloLango/jerryscript","description":"","fork":true,"url":"https://api.github.com/repos/LaszloLango/jerryscript","forks_url":"https://api.github.com/repos/LaszloLango/jerryscript/forks","keys_url":"https://api.github.com/repos/LaszloLango/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LaszloLango/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LaszloLango/jerryscript/teams","hooks_url":"https://api.github.com/repos/LaszloLango/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/LaszloLango/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/LaszloLango/jerryscript/events","assignees_url":"https://api.github.com/repos/LaszloLango/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/LaszloLango/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/LaszloLango/jerryscript/tags","blobs_url":"https://api.github.com/repos/LaszloLango/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LaszloLango/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LaszloLango/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/LaszloLango/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LaszloLango/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/LaszloLango/jerryscript/languages","stargazers_url":"https://api.github.com/repos/LaszloLango/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/LaszloLango/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/LaszloLango/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/LaszloLango/jerryscript/subscription","commits_url":"https://api.github.com/repos/LaszloLango/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/LaszloLango/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/LaszloLango/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/LaszloLango/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/LaszloLango/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/LaszloLango/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LaszloLango/jerryscript/merges","archive_url":"https://api.github.com/repos/LaszloLango/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LaszloLango/jerryscript/downloads","issues_url":"https://api.github.com/repos/LaszloLango/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/LaszloLango/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/LaszloLango/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/LaszloLango/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LaszloLango/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/LaszloLango/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/LaszloLango/jerryscript/deployments","created_at":"2015-07-02T12:47:42Z","updated_at":"2016-02-17T14:18:30Z","pushed_at":"2016-03-09T10:45:06Z","git_url":"git://github.com/LaszloLango/jerryscript.git","ssh_url":"git@github.com:LaszloLango/jerryscript.git","clone_url":"https://github.com/LaszloLango/jerryscript.git","svn_url":"https://github.com/LaszloLango/jerryscript","homepage":null,"size":6782,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"Samsung:master","ref":"master","sha":"81d4c97a3a333230d71e8ee69759f3497681f75c","user":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":33339660,"name":"jerryscript","full_name":"Samsung/jerryscript","owner":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/jerryscript","description":"Ultra-lightweight JavaScript engine for Internet of Things. http://www.jerryscript.net","fork":false,"url":"https://api.github.com/repos/Samsung/jerryscript","forks_url":"https://api.github.com/repos/Samsung/jerryscript/forks","keys_url":"https://api.github.com/repos/Samsung/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/jerryscript/teams","hooks_url":"https://api.github.com/repos/Samsung/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/Samsung/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/jerryscript/events","assignees_url":"https://api.github.com/repos/Samsung/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/jerryscript/tags","blobs_url":"https://api.github.com/repos/Samsung/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/jerryscript/languages","stargazers_url":"https://api.github.com/repos/Samsung/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/Samsung/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/Samsung/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/Samsung/jerryscript/subscription","commits_url":"https://api.github.com/repos/Samsung/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/jerryscript/merges","archive_url":"https://api.github.com/repos/Samsung/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/jerryscript/downloads","issues_url":"https://api.github.com/repos/Samsung/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/jerryscript/deployments","created_at":"2015-04-03T01:10:31Z","updated_at":"2016-03-09T10:33:32Z","pushed_at":"2016-03-09T10:45:07Z","git_url":"git://github.com/Samsung/jerryscript.git","ssh_url":"git@github.com:Samsung/jerryscript.git","clone_url":"https://github.com/Samsung/jerryscript.git","svn_url":"https://github.com/Samsung/jerryscript","homepage":"","size":10567,"stargazers_count":1183,"watchers_count":1183,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":121,"mirror_url":null,"open_issues_count":55,"forks":121,"open_issues":55,"watchers":1183,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/947"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/947"},"issue":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/947"},"comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/947/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/947/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/947/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/jerryscript/statuses/7891675d7088aecc9b851b8753628757b90b5e2a"}}}}