Skip to content

C/JS accessors for function table segments - #2565

Closed
bvibber wants to merge 1 commit into
WebAssembly:masterfrom
bvibber:accessors
Closed

bvibber wants to merge 1 commit into
WebAssembly:masterfrom
bvibber:accessors

Conversation

@bvibber

@bvibber bvibber commented Jan 1, 2020

Copy link
Copy Markdown
Contributor

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

COFFEETALES commented Jan 1, 2020 •

Copy link
Copy Markdown
Contributor

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

@bvibber

bvibber commented Jan 1, 2020

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

bvibber commented Jan 2, 2020

Copy link
Copy Markdown
Contributor Author

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