{"action":"created","issue":{"url":"https://api.github.com/repos/raptorjit/raptorjit/issues/110","repository_url":"https://api.github.com/repos/raptorjit/raptorjit","labels_url":"https://api.github.com/repos/raptorjit/raptorjit/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/raptorjit/raptorjit/issues/110/comments","events_url":"https://api.github.com/repos/raptorjit/raptorjit/issues/110/events","html_url":"https://github.com/raptorjit/raptorjit/issues/110","id":257445523,"number":110,"title":"How does stack frame unwinding work?","user":{"login":"lukego","id":13791,"avatar_url":"https://avatars0.githubusercontent.com/u/13791?v=4","gravatar_id":"","url":"https://api.github.com/users/lukego","html_url":"https://github.com/lukego","followers_url":"https://api.github.com/users/lukego/followers","following_url":"https://api.github.com/users/lukego/following{/other_user}","gists_url":"https://api.github.com/users/lukego/gists{/gist_id}","starred_url":"https://api.github.com/users/lukego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukego/subscriptions","organizations_url":"https://api.github.com/users/lukego/orgs","repos_url":"https://api.github.com/users/lukego/repos","events_url":"https://api.github.com/users/lukego/events{/privacy}","received_events_url":"https://api.github.com/users/lukego/received_events","type":"User","site_admin":false},"labels":[{"id":559138332,"url":"https://api.github.com/repos/raptorjit/raptorjit/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-09-13T16:35:56Z","updated_at":"2017-09-14T11:09:29Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I have to understand how stack frames and unwinding works. I also want to understand whether this can be simplified by dropping support for some complex scenarios e.g. exceptions propagating through interleaved Lua and C++ stack frames.\r\n\r\nThis is especially relevant to rewriting the VM in C (#93) and wanting to keep it simple and avoid potential dependencies on the C compiler. How simple can we make everything? What functionality will that cost us?\r\n\r\nAnybody already understand this and care to offer some hints for getting started?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/raptorjit/raptorjit/issues/comments/329450143","html_url":"https://github.com/raptorjit/raptorjit/issues/110#issuecomment-329450143","issue_url":"https://api.github.com/repos/raptorjit/raptorjit/issues/110","id":329450143,"user":{"login":"igelhaus","id":6665150,"avatar_url":"https://avatars2.githubusercontent.com/u/6665150?v=4","gravatar_id":"","url":"https://api.github.com/users/igelhaus","html_url":"https://github.com/igelhaus","followers_url":"https://api.github.com/users/igelhaus/followers","following_url":"https://api.github.com/users/igelhaus/following{/other_user}","gists_url":"https://api.github.com/users/igelhaus/gists{/gist_id}","starred_url":"https://api.github.com/users/igelhaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igelhaus/subscriptions","organizations_url":"https://api.github.com/users/igelhaus/orgs","repos_url":"https://api.github.com/users/igelhaus/repos","events_url":"https://api.github.com/users/igelhaus/events{/privacy}","received_events_url":"https://api.github.com/users/igelhaus/received_events","type":"User","site_admin":false},"created_at":"2017-09-14T11:09:29Z","updated_at":"2017-09-14T11:09:29Z","author_association":"NONE","body":"@lukego no worries, I'm often bad at explaining things.\r\n\r\n> So the whole unwinding mechanisms exists in order for...\r\n\r\nGenerally speaking, yes. You have a few interfaces that are able to catch Lua-level run-time errors: `pcall`, `xpcall`, `lua_pcall`, `lua_cpcall`, `coroutine.resume`, and `lua_resume`. The whole unwinding stuff is here to be able to transfer control to these protection points whenever an exception occurs.\r\n\r\nBut since the implementation of the exception handling in LuaJIT uses the same mechanism as C++ exceptions use, Lua-level exceptions are \"automatically compatible\" with the C++ environment. Unless you don't have to interact with C++ code, you don't worry about this compatibility, but once you do, you get correct exception handling for free (`setjmp`/`longjmp` are not of much help here).\r\n\r\nAs far as I know, PUC-Rio Lua implements exception handling with `setjmp`/`longjmp` and does not care about C++ exception handling.\r\n"}}
{"actor":{"display_login":"igelhaus"}}