Skip to content

br_table binary format differs from AstSemantics and spec #658

Closed

Description

@binji

The br_table operator is specified in AstSemantics as taking one expression that yields a value for the exited construct. This matches the spec as implemented ml-proto.

But BinaryEncoding says that br_table takes just one expression as input (the key), and doesn't mention this additional expression for the break value. AFIAK all the browser implementations match this, or they wouldn't be able to run the AngryBots wasm file.

Activity

  1. added this to the MVP milestone on Apr 19, 2016
  2. rossberg commented on Apr 19, 2016

    @rossberg
    Member

    I think BinaryEncoding needs updating. This should probably be part of Binary 11. I'll prepare a PR.

  3. lukewagner commented on Apr 20, 2016

    @lukewagner
    Member

    I don't think the AngryBots wasm file includes a br_table value; we haven't implemented that yet in SM.

  4. kripken commented on Apr 21, 2016

    @kripken
    Member

    I do see br_table in AngryBots. Most switches would turn into br_tables.

  5. kripken commented on Apr 21, 2016

    @kripken
    Member

    Oh sorry, I misunderstood. Thanks for the clarification. Yes, there are no branch return values in asm2wasm output currently, so none in AngryBots.

    I am experimenting with block/branch return values in the block-return branch of binaryen currently. I don't have things fully working yet, but it looks promising, can remove a few % of set_locals.

  6. jfbastien commented on Dec 15, 2016

    @jfbastien
    Member

    Has this been resolved?

  7. binji commented on Dec 16, 2016

    @binji
    MemberAuthor

    Yes, I think this is both resolved and stale. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions