Skip to content

Use LEB for br_table #735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Use LEB for br_table #735

wants to merge 1 commit into from

Conversation

titzer
Copy link

@titzer titzer commented Aug 1, 2016

A very significant portion of the AngryBots and BananaBread demo binaries is taken by br_table opcodes. In fact, in both of these binaries, the total space consumed by br_table is more than br and br_if combined. This PR proposes using LEBs in the encoding of br_table. LEBs are more space-efficient than uint32 for the very common case of br_table target entries being smaller than 4 bytes, and they are more consistent with the rest of the format.

A possible followup would be require the length of the entire br_table as an immediate as well, to allow for bytecode iterators to skip ahead without decoding the entire table.

LEBs are more space-efficient than uint32 for the very common case of br_table target entries being smaller than 4 bytes.
@lukewagner
Copy link
Member

lgtm

1 similar comment
@sunfishcode
Copy link
Member

lgtm

@sunfishcode sunfishcode added this to the MVP milestone Aug 1, 2016
@titzer titzer mentioned this pull request Aug 1, 2016
@titzer
Copy link
Author

titzer commented Aug 1, 2016

Closing in favor of #738 (merge into 0xC instead of master)
#738

@titzer titzer closed this Aug 1, 2016
@titzer titzer deleted the binary_0xc_br_table_leb branch August 1, 2016 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants