Skip to content

Multiple tables support from the reference-types proposal #3512

Closed

Description

@martianboy

Hi, recently I've been curious about the reference-types proposal and I was trying to play around with it in various tools when I found out that wasm-opt doesn't like it when I give it a wasm file with multiple tables. So for the last 2-3 days I started digging through Binaryen's codes as well as some of the communications happening on this Github repo, trying to understand the situation.

So far, I found PR #2451 which added support for reference-types, but left multiple tables support and table instructions out. I also checked PR #3084 quickly, that brought the existing implementation up to date with recent changes from the proposal.

But nowhere can I find any mention of the missing support for multiple tables, which makes me feel like I am missing something: Has it been a non-goal for Binaryen to support this, or somehow the cost hasn't been worth the effort to fully implement the remaining parts, or it's just been low on priority. This is just me being curious.

I also went through the codebase, played around with the idea of replacing the single table object in Binaryen's Wasm module IR, with a std::vector<std::unique_ptr<Table>> just like the other module elements. With some help I will be able to publish it as a PR, potentially preparing the stage for full implementation of the proposal in the future.

So I just wanted to check whether I should continue this work, or there are important notes that I'm missing. I'd also appreciate any insight or directions.

Activity

  1. aheejin commented on Jan 25, 2021

    @aheejin
    Member

    As you noticed, Binaryen does not yet support multiple tables. We only have reference types and subtype relationship for now. We didn't implement it at the time just because it was not a high priority for us, because our LLVM toolchain did not generate multiple tables. @sbc100, do we support multiple tables in LLVM now?

    Either way, you can submit PRs for its support and we would appreciate it.

  2. martianboy commented on Jan 25, 2021

    @martianboy
    ContributorAuthor

    Thanks for the reply. I come from a RustWasm and wasm-bindgen background which does have an option for reference-types to generate multiple tables.

    I am almost finished with the first stage of my changes, just trying to make sure the test suite passes without any substantial change in the functionality. I will submit a PR once it's done, and I will appreciate reviews, comments, etc. :)

  3. sbc100 commented on Jan 25, 2021

    @sbc100
    Member

    The multi-table support in llvm/lld is being worked on right now by @wingo and should land any day now. So it does seem like the right time to add multi-table support for binaryen. Any PRs to add such support I think would be very welcome.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions