{"action":"created","issue":{"url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/155","repository_url":"https://api.github.com/repos/rustwasm/wasm-bindgen","labels_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/155/comments","events_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/155/events","html_url":"https://github.com/rustwasm/wasm-bindgen/pull/155","id":316519666,"number":155,"title":"Mark JsValue idx as NonZeroU32","user":{"login":"sophiebits","id":6820,"avatar_url":"https://avatars2.githubusercontent.com/u/6820?v=4","gravatar_id":"","url":"https://api.github.com/users/sophiebits","html_url":"https://github.com/sophiebits","followers_url":"https://api.github.com/users/sophiebits/followers","following_url":"https://api.github.com/users/sophiebits/following{/other_user}","gists_url":"https://api.github.com/users/sophiebits/gists{/gist_id}","starred_url":"https://api.github.com/users/sophiebits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophiebits/subscriptions","organizations_url":"https://api.github.com/users/sophiebits/orgs","repos_url":"https://api.github.com/users/sophiebits/repos","events_url":"https://api.github.com/users/sophiebits/events{/privacy}","received_events_url":"https://api.github.com/users/sophiebits/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-21T19:40:39Z","updated_at":"2018-04-21T21:09:00Z","closed_at":"2018-04-21T19:41:35Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/rustwasm/wasm-bindgen/pulls/155","html_url":"https://github.com/rustwasm/wasm-bindgen/pull/155","diff_url":"https://github.com/rustwasm/wasm-bindgen/pull/155.diff","patch_url":"https://github.com/rustwasm/wasm-bindgen/pull/155.patch"},"body":"I noticed in the generated wasm for examples/dom that `JsStatic` takes two words of storage (for its `Option<JsValue>`) when it would seem to only need one, if we mandate that `0` is not a valid heap index. Changing the `.idx` type to `NonZeroU32` fixes this.\n\nHowever, LLVM doesn't know that these values are non-zero yet (https://github.com/rust-lang/rust/issues/49572) which means in the implementation of Option's `get_or_insert_with` (https://doc.rust-lang.org/nightly/src/core/option.rs.html#774) LLVM is no longer able to prove that the `unreachable!()` branch is never hit and thus JsStatic ends up pulling in all the panic infrastructure where it previously didn't. This results in the examples/dom output being much larger, rather than smaller as I had hoped. Probably makes sense to wait for the upstream issue to be fixed so that this can be landed without regressing anything."},"comment":{"url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/comments/383331340","html_url":"https://github.com/rustwasm/wasm-bindgen/pull/155#issuecomment-383331340","issue_url":"https://api.github.com/repos/rustwasm/wasm-bindgen/issues/155","id":383331340,"user":{"login":"sophiebits","id":6820,"avatar_url":"https://avatars2.githubusercontent.com/u/6820?v=4","gravatar_id":"","url":"https://api.github.com/users/sophiebits","html_url":"https://github.com/sophiebits","followers_url":"https://api.github.com/users/sophiebits/followers","following_url":"https://api.github.com/users/sophiebits/following{/other_user}","gists_url":"https://api.github.com/users/sophiebits/gists{/gist_id}","starred_url":"https://api.github.com/users/sophiebits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sophiebits/subscriptions","organizations_url":"https://api.github.com/users/sophiebits/orgs","repos_url":"https://api.github.com/users/sophiebits/repos","events_url":"https://api.github.com/users/sophiebits/events{/privacy}","received_events_url":"https://api.github.com/users/sophiebits/received_events","type":"User","site_admin":false},"created_at":"2018-04-21T21:09:00Z","updated_at":"2018-04-21T21:09:00Z","author_association":"CONTRIBUTOR","body":"I'm not actually sure what subpar codegen you had observed."}}
{"actor":{"display_login":"sophiebits"}}