Skip to content

C/JS accessors for function table segments #2565

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

Conversation

bvibber
Copy link
Contributor

@bvibber bvibber commented Jan 1, 2020

module.getNumFunctionTableSegments() gives the number of segments.

module.getFunctionTableSegmentInfoByIndex() yields:

{
  offset,
  functions: ["func1", "func2"]
}

Another piece for #2370

bvibber added a commit to bvibber/wasm2swf that referenced this pull request Jan 1, 2020
module.getNumFunctionTableSegments() gives the number of segments.

module.getFunctionTableSegmentInfoByIndex() yields:
```
{
  offset,
  functions: ["func1", "func2"]
}
```

Another piece for WebAssembly#2370
@COFFEETALES
Copy link
Contributor

COFFEETALES commented Jan 1, 2020

Great stuff.
I have done a similar work at #2554
At least, we will definitively get something for the function table 👍

@bvibber
Copy link
Contributor Author

bvibber commented Jan 1, 2020

Heh, didn't see yours... :) I like your version better, it has the import marker and can support non constant init I think?

@COFFEETALES
Copy link
Contributor

Thanks, but you did well too.

In my version, the offset is treated as a regular wasm expression.
The user has to fetch the content with getExpressionInfo(segment.offset).
I think it's cleaner than trying to find out what lies behind the expression.

At some point, it could be relevant to use the same approach for getMemorySegmentInfoByIndex.
I don't know, just an idea...

@bvibber
Copy link
Contributor Author

bvibber commented Jan 2, 2020

Closing in favor of #2554

@bvibber bvibber closed this Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants