{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2572","repository_url":"https://api.github.com/repos/Microsoft/ChakraCore","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2572/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2572/comments","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2572/events","html_url":"https://github.com/Microsoft/ChakraCore/issues/2572","id":209304805,"number":2572,"title":"Stackoverflow checks (interrupts) in loops by default in ch.exe","user":{"login":"Krovatkin","id":5086322,"avatar_url":"https://avatars.githubusercontent.com/u/5086322?v=3","gravatar_id":"","url":"https://api.github.com/users/Krovatkin","html_url":"https://github.com/Krovatkin","followers_url":"https://api.github.com/users/Krovatkin/followers","following_url":"https://api.github.com/users/Krovatkin/following{/other_user}","gists_url":"https://api.github.com/users/Krovatkin/gists{/gist_id}","starred_url":"https://api.github.com/users/Krovatkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Krovatkin/subscriptions","organizations_url":"https://api.github.com/users/Krovatkin/orgs","repos_url":"https://api.github.com/users/Krovatkin/repos","events_url":"https://api.github.com/users/Krovatkin/events{/privacy}","received_events_url":"https://api.github.com/users/Krovatkin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-21T23:24:28Z","updated_at":"2017-02-21T23:24:28Z","closed_at":null,"body":"By default, ChakraCore inserts stackoverflow checks into loop headers even though there doesn't seem to be any logic in ChakraCore, taking advantage of these \"interrupts\". \r\n\r\nThis simple testcase triggers this behaviour\r\n\r\n```javascript\r\nfunction AsmModule() {\r\n    \"use asm\";\r\n    function f1(){\r\n    var x=0;\r\n\twhile((x|0) < (2147483640|0)) {\r\n\tx=x+1|0;\r\n\t}\r\n\treturn (x)|0;\r\n    }\r\n    return f1\r\n}\r\nvar f1 = AsmModule();\r\nf1();\r\n```\r\n\r\n```\r\nch.exe -maic:0 -dump:encoder\r\n```\r\n\r\nA stackoverflow check inserted in a loop header.\r\n```\r\n212F8D50056  $L1: >>>>>>>>>>>>>  LOOP TOP  >>>>>>>>>>>>>\r\n 212F8D50056   s23(rax).u64 = MOV     0x020AF8BC0A88 (&StackLimit).u64\r\n 212F8D50060           CMP            (rsp).i64, [s23(rax).u64 <0x020AF8BC0A88 (&StackLimit)>].i64\r\n 212F8D50063           JLE            $L9\r\n```\r\n\r\nWe were wondering if this behaviour could be disabled by default? @LouisLaf @dilijev \r\n\r\nPR: https://github.com/Microsoft/ChakraCore/pull/2569"}}
{"actor":{"display_login":"Krovatkin"}}