{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/binaryen/issues/537","repository_url":"https://api.github.com/repos/WebAssembly/binaryen","labels_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/537/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/537/comments","events_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/537/events","html_url":"https://github.com/WebAssembly/binaryen/pull/537","id":156262536,"number":537,"title":"Make the wasm AST's Index type a class like Address","user":{"login":"dschuff","id":1122856,"avatar_url":"https://avatars.githubusercontent.com/u/1122856?v=3","gravatar_id":"","url":"https://api.github.com/users/dschuff","html_url":"https://github.com/dschuff","followers_url":"https://api.github.com/users/dschuff/followers","following_url":"https://api.github.com/users/dschuff/following{/other_user}","gists_url":"https://api.github.com/users/dschuff/gists{/gist_id}","starred_url":"https://api.github.com/users/dschuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dschuff/subscriptions","organizations_url":"https://api.github.com/users/dschuff/orgs","repos_url":"https://api.github.com/users/dschuff/repos","events_url":"https://api.github.com/users/dschuff/events{/privacy}","received_events_url":"https://api.github.com/users/dschuff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-23T11:51:23Z","updated_at":"2016-05-23T21:03:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/WebAssembly/binaryen/pulls/537","html_url":"https://github.com/WebAssembly/binaryen/pull/537","diff_url":"https://github.com/WebAssembly/binaryen/pull/537.diff","patch_url":"https://github.com/WebAssembly/binaryen/pull/537.patch"},"body":"Generalize the previous Address class for use with local indices too. This\r\nshould allow more implicit conversions and less casting, with extra\r\nassertions."},"comment":{"url":"https://api.github.com/repos/WebAssembly/binaryen/issues/comments/221095573","html_url":"https://github.com/WebAssembly/binaryen/pull/537#issuecomment-221095573","issue_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/537","id":221095573,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2016-05-23T21:03:36Z","updated_at":"2016-05-23T21:03:36Z","body":"A downside to this class approach is that `Index x` and `Address y` become structs. We rely on compiler opts to make things fast. Did we verify that? I don't worry about Address, because it's rare, but Index is literally everywhere all the time.\r\n\r\nA further downside is that this can cause subtle FFI bugs, e.g. in wasm-js.cpp, we send an `Address x` into an `EM_ASM` (which is a varargs function), and when it became a struct it silently started to pass the address of the struct. Wasn't hard to find with bisection, but annoying that there isn't a compiler warning. I can live with that though.\r\n\r\nOn a side note, this does raise the issue of what to do with wasm64 eventually. We should at least plan for it I think. My current thoughts are that it's not worth supporting both wasm32 and 64 in a single build, instead it could be a build-time flag. That way in wasm32 - the more common case by far, I think, for quite some time - we don't have larger data structures, and we don't have runtime checks \"is this wasm32?\" etc. in many places."}}
{"actor":{"display_login":"kripken"}}