{"action":"opened","issue":{"url":"https://api.github.com/repos/dragome/dragome-sdk/issues/116","repository_url":"https://api.github.com/repos/dragome/dragome-sdk","labels_url":"https://api.github.com/repos/dragome/dragome-sdk/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/dragome/dragome-sdk/issues/116/comments","events_url":"https://api.github.com/repos/dragome/dragome-sdk/issues/116/events","html_url":"https://github.com/dragome/dragome-sdk/issues/116","id":163749800,"number":116,"title":"Small strict compiler improvement","user":{"login":"xpenatan","id":6472084,"avatar_url":"https://avatars.githubusercontent.com/u/6472084?v=3","gravatar_id":"","url":"https://api.github.com/users/xpenatan","html_url":"https://github.com/xpenatan","followers_url":"https://api.github.com/users/xpenatan/followers","following_url":"https://api.github.com/users/xpenatan/following{/other_user}","gists_url":"https://api.github.com/users/xpenatan/gists{/gist_id}","starred_url":"https://api.github.com/users/xpenatan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xpenatan/subscriptions","organizations_url":"https://api.github.com/users/xpenatan/orgs","repos_url":"https://api.github.com/users/xpenatan/repos","events_url":"https://api.github.com/users/xpenatan/events{/privacy}","received_events_url":"https://api.github.com/users/xpenatan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-04T22:59:50Z","updated_at":"2016-07-04T22:59:50Z","closed_at":null,"body":"The second compiler is new to me. After analyzing that it reuse variables for some operators I detected that it sometimes a variable receive the same variable (ex: var t1 = 10; t1 = t1;).  \r\n\r\nIts not much but its better to keep small issues away.\r\n\r\n```Javaj\r\n\tpublic int get(int i) {\r\n\t\treturn 0;\r\n\t}\r\n\t\r\n\t@DragomeCompilerSettings(CompilerType.Strict)\r\n\tpublic void strictTest() {\r\n\t\tint i = 0;\r\n\t\tfloat test = (long)get(i++) << 32;\r\n\t}\r\n```\r\n\r\nThe code aboe generates: \r\n\r\n```\r\n$get___int$int: function (i)\r\n{\r\n\treturn 0;\r\n},\r\n$strictTest$void : function()\r\n    {\r\n       var __r0, __r1, __r2, __r3, __r5, __r6;\r\n        __r6 = this;\r\n        var __next_label = -1;\r\n        while (1) {\r\n          switch (__next_label) {\r\n            case -1:\r\n            __r0 = 0;\r\n            __r1 = __r0 + 1;\r\n            __r3 = __r6.$get___int$int(__r0);\r\n            __r3 = __r3;\r\n            __r5 = 32;\r\n           __r3 = __r3 << 5;\r\n            __r2 = __r3 * 1.0;\r\n            return this;\r\n            default:\r\n              alert(\"XMLVM internal error: reached default of switch\");\r\n          }\r\n        }\r\n    },\r\n```\r\n\r\nThe issue is \"r3 = r3\"  is not needed.\r\n "}}
{"actor":{"display_login":"xpenatan"}}